Skip to content

Conversation

@AustrianDudes
Copy link

I am currently working on several apps where I use greenDao to access a Sqlite database created by another module. This database does not include underscores in table and property names which consist of more than one word e.g. DELETEDDATE.

A solution for this issue would be to not use camel casing in the code’s table and property names e.g. addDateProperty("Deleteddate"), but this looks weird and does not fall in line with Google’s Java Style Guide Chapter 5.2.5 (https://google.github.io/styleguide/javaguide.html).

Another solution would be to use camel casing in the code’s table and property names and additionally specify the database naming e.g. addDateProperty("DeletedDate").columnName("DELETEDDATE"), but this approach is quite a hassle for a large amount of tables and properties (I can provide you with some examples).

Thus I implemented the possibility to generally switch off the underscore insertion for table and property names.

Schema schema = new Schema(1, "com.demo.green");
schema.enableCamelCaseNameWithoutInsertions();

Feel free to accept the pull request if you like the changes, or ask me for further information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant