<commit_before># TL;DR
In this framework, objects are a representation of a tuple in the Java world, the only thing you need to take care of is how to map columns to fields. Conversion between snakeCase for the Java beans and camel_case for the database is by default and foreign keys adds implicitly \_id at the end. Custom behaviour is customized with @Column. Accessing fields is made using the standard ways.

# Naming conventions
The naming convention is the default behaviour of translating a bean property name in a column name. This behaviour is driven by an implementation of the interface [NamingConvention](../core/src/main/java/fr/petitl/relational/repository/template/bean/NamingConvention.java).                                                     

## Default behaviour
In relational database the case-sensitivity is often problematic. This is often due to the casing support in file systems. That is why the most common column names in databases are camel cased. Also, JDBC column names case in ResultSetMetaData are often forced. Therefore, by default, all fields are named using their camel cased form for their column name.

The default behaviour is available in [CamelToSnakeConvention](../core/src/main/java/fr/petitl/relational/repository/template/bean/CamelToSnakeConvention.java).

Some examples:

| Field Name   | Column Name    |
| ------------ |----------------|
| createdBy    | created_by     |
| addressLine2 | address_line_2 |
| someFKId     | some_fk_id     |
| created_by   | created_by     |

As you can see, the conversion is done as close as possible to the human interpretation.

### Foreign Keys
A foreign key field is a field that leads to an other table primary key. Therefore, in classical database design, a postfix ```\_id``` is often used. To do this the most efficient way without hurting too much the field naming, this postfix is automatically added if the field is detected as a foreign key handle (see [the foreign key documentation](ForeignKey)) AND if the generated column name does not already have the postfix at the end.

This way you would have the following mapping:
```java
class A {
    // Maps to id
    int id;
    
    // Maps to first_name
    String firstName;
    
    // Maps to account_id
    FK<Integer, Account> account;
}<commit_msg>Fixing trailing backslash<commit_after># TL;DR
In this framework, objects are a representation of a tuple in the Java world, the only thing you need to take care of is how to map columns to fields. Conversion between snakeCase for the Java beans and camel_case for the database is by default and foreign keys adds implicitly \_id at the end. Custom behaviour is customized with @Column. Accessing fields is made using the standard ways.

# Naming conventions
The naming convention is the default behaviour of translating a bean property name in a column name. This behaviour is driven by an implementation of the interface [NamingConvention](../core/src/main/java/fr/petitl/relational/repository/template/bean/NamingConvention.java).                                                     

## Default behaviour
In relational database the case-sensitivity is often problematic. This is often due to the casing support in file systems. That is why the most common column names in databases are camel cased. Also, JDBC column names case in ResultSetMetaData are often forced. Therefore, by default, all fields are named using their camel cased form for their column name.

The default behaviour is available in [CamelToSnakeConvention](../core/src/main/java/fr/petitl/relational/repository/template/bean/CamelToSnakeConvention.java).

Some examples:

| Field Name   | Column Name    |
| ------------ |----------------|
| createdBy    | created_by     |
| addressLine2 | address_line_2 |
| someFKId     | some_fk_id     |
| created_by   | created_by     |

As you can see, the conversion is done as close as possible to the human interpretation.

### Foreign Keys
A foreign key field is a field that leads to an other table primary key. Therefore, in classical database design, a postfix ```_id``` is often used. To do this the most efficient way without hurting too much the field naming, this postfix is automatically added if the field is detected as a foreign key handle (see [the foreign key documentation](ForeignKey)) AND if the generated column name does not already have the postfix at the end.

This way you would have the following mapping:
```java
class A {
    // Maps to id
    int id;
    
    // Maps to first_name
    String firstName;
    
    // Maps to account_id
    FK<Integer, Account> account;
}
{'fraction_non_alphanumeric': 0.06608884073672806, 'fraction_numerical': 0.000866738894907909, 'mean_word_length': 3.3629489603024574, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1957465', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1121, 'n_words': 604}