tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BKumar <bibhuti.ku...@creditpointe.com>
Subject How to tell openejb to use only supplied orm over generated for CMP2.1
Date Wed, 09 Jan 2013 10:10:33 GMT
Hi,

According to  documentation, I  have saved the openejb-cmp-generated-orm.xml
and changed it to  supply  my sequence generator.After that I placed
openejb-cmp-generated-orm.xml inside META-INF of my entity bean and also
having proper entry in persistenace.xml. When I  start my tomee+ server it
loads and scan two mapping discriptor file i.e. one that I have supplied and
one that is generated by the server.

Here I  am observing that, some time it load openejb-cmp-generated-orm.xml
and run properly. when it load  generated openejb-cmp-generated-orm.xm then
it is unable to generate sequence.

Message I  have observed in server log.
Found duplicate metadata or mapping for "class openejb.com.rage.EmpBean".  



1. Generated : openejb-cmp-generated-orm.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
version="1.0">
    <entity class="openejb.com.rage.EmpBean" name="EmpBean">
        <description>EntityBean#Emp</description>
        

        <attributes>
            <id name="id">
                <column name="ID"/>
                 <generated-value strategy="IDENTITY"/>
            
            </id>
            <basic name="name">
                <column name="name1"/>
            </basic>
            <basic name="des">
                <column name="des"/>
            </basic>
        </attributes>
    </entity>
</entity-mappings>

2. Supplied : openejb-cmp-generated-orm.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
version="1.0">
    <entity class="openejb.com.rage.EmpBean" name="EmpBean">
        <description>EntityBean#Emp</description>
        

        <attributes>
            <id name="id">
                <column name="ID"/>
                <generated-value strategy="TABLE" generator="RD_SEQUENCE1"/>
            	<table-generator name="RD_SEQUENCE1"
table="RAGE_SEQUENCE_MASTER" pk-column-name="SEQUENCE_NAME"
                value-column-name="SEQUENCE_NUMBER"
pk-column-value="RD_SEQUENCE"/>
            </id>
            <basic name="name">
                <column name="name1"/>
            </basic>
            <basic name="des">
                <column name="des"/>
            </basic>
        </attributes>
    </entity>
</entity-mappings>

Thanks,
BKumar




--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-tell-openejb-to-use-only-supplied-orm-over-generated-for-CMP2-1-tp4660196.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message