-->
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: EJB Column annotation
PostPosted: Fri Apr 11, 2008 8:05 pm 
Newbie

Joined: Tue Apr 01, 2008 2:52 pm
Posts: 6
It looks like I hit a bug either in java.persistence javadoc or in Hibernate implementation.
The definition of table field for @Column says:

Quote:
The name of the table that contains the column. If absent the column is assumed to be in the primary table.


It is not stated that it should not be the primary table. However, if you don't have any secondary table and put the primary table in the field, Hibernate raises exception:

Code:
org.hibernate.AnnotationException: Cannot find the expected secondary table: no <table-name> available for <entity-name>
   at org.hibernate.cfg.Ejb3Column.getJoin(Ejb3Column.java:293)
   at org.hibernate.cfg.Ejb3Column.getTable(Ejb3Column.java:272)
   at org.hibernate.cfg.annotations.SimpleValueBinder.make(SimpleValueBinder.java:222)
   at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1905)
   at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1281)
   at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:754)
   at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:534)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
   at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
   at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
   at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)


I think if this field is supposed to hold only the secondary table, it should be stated explicitly in the javadoc.

Am I wrong?

Thanks,
Yevgeny


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.