I have a project that the client want me to re-use (by sharing src directory directly) their existing JPA-annotated classes on Android. I would like to use ormlite in my project (despite the underlying DB will be H2) but the classes use some JPA annotations that ormlite does not support (@IdClass with composite primary key object, entity with multiple @Id columns, @OneToMany).

My question is, Will configuring the classes using Java code override the JPA annotations? Or is there other ways around this? Thanks.

有帮助吗?

解决方案

By passing in a DatabaseTableConfig<T> during dao initialization, the table config takes precedence and all JPA annotations are ignored. So the answer to my own question is YES, it will override JPA annotation.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top