Hello all,
I have a couple of questions regarding specification of JPA 2.1 mappings in the orm.xml file, and the annotation metamodel:
- I have an abstract domain class that has a couple of attributes, an id and a version attribute which is an Integer. In my orm.xml file, I specify it as follows:
Code:
<mapped-superclass class="com.example.entity.base.AbstractEntity">
<attributes>
<id name="id" />
<basic name="creationDateTime">
<column name="creation_date_time" nullable="false" />
</basic>
<basic name="lastUpdateDateTime">
<column name="last_update_date_time" nullable="false" />
</basic>
<version name="version">
<column name="version"/>
</version>
</attributes>
</mapped-superclass>
Upon running the metamodel generator from within Maven, I see all other attributes of my class in the metamodel except for the version column. Any ideas here as to why this may be? The same class with annotations defined in the class produces a metamodel that properly includes the version column.
- Next up, in another concrete class that extends the above domain class, I have an attribute called binaryData which is an array of bytes, i.e.,
Code:
private byte[] binaryData;
. In my orm.xml file, I specify it as follows:
Code:
...
<basic name="binaryData">
<column name="binary_data" nullable="false" />
<lob />
</basic>
...
Again, for this column, I do not see a metamodel attribute being generated.
Any thoughts on how to solve these problems would be most appreciated. I am using version 4.3.7.Final of hibernate-core, hibernate-entitymanager and hibernate-jpamodelgen.
Thanks and kind regards,
Prashanth