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

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


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