[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-569) Map the same class twice in orm.xml

Christian Bauer (JIRA) noreply at atlassian.com
Sun Mar 4 18:04:31 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-569?page=comments#action_26371 ] 

Christian Bauer commented on ANN-569:
-------------------------------------

If we can't, I don't see any usecase at all for entity names in EJB 3 (I can specify discriminator values easier than that). Why would I use an alias for an entity class, if I can create only a single alias and I can only use it in JPA QL queries? The alias is no different than the original entity class name.


> Map the same class twice in orm.xml
> -----------------------------------
>
>          Key: ANN-569
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-569
>      Project: Hibernate Annotations
>         Type: New Feature

>   Components: binder
>     Reporter: Christian Bauer
>     Priority: Minor

>
>
> Regular annotated class, I'd like to map it again in orm.xml with a different set of persistent attributes (they are annotated transient in the regular class):
>     <!-- If I don't have the regular class mapped here, I get only a NODE_HISTORY table. I want two tables. -->
>     <entity class="Node" name="RegularNode" access="FIELD">
>         <table name="NODE"/>
>     </entity>
>     <entity class="Node" name="HistoricalNode" access="FIELD">
>         <table name="NODE_HISTORY"/>
>         <attributes>
>             <id name="historicalNodeId">
>                 <column name="NODE_HISTORY_ID"/>
>                 <generated-value/>
>             </id>
>             <basic name="revision" optional="false">
>                 <column name="NODE_REVISION"/>
>             </basic>
>             <basic name="id" optional="false">
>                 <column name="NODE_ID"/>
>             </basic>
>         </attributes>
>     </entity>
> I currently only have 3.2.0 CR1 (Seam...) here:
> [hibernatetool] javax.persistence.PersistenceException: java.lang.IllegalStateException: Duplicate XML entry for org.jboss.seam.wiki.core.node.Node
> [hibernatetool] java.lang.IllegalStateException: Duplicate XML entry for org.jboss.seam.wiki.core.node.Node
> If the spec forbids duplicate class names in orm.xml (does it?) - how can I override mappings under a different entity alias?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list