-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Annotation Metamodel and JPA 2.1 orm.xml Mappings
PostPosted: Mon Jan 05, 2015 2:17 pm 
Newbie

Joined: Mon Jan 05, 2015 1:39 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.