You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by BKumar <bi...@creditpointe.com> on 2013/01/09 11:10:33 UTC

How to tell openejb to use only supplied orm over generated for CMP2.1

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.

Re: How to tell openejb to use only supplied orm over generated for CMP2.1

Posted by Romain Manni-Bucau <rm...@gmail.com>.
yeah open a jira and you can attach a patch to it (granting it to Apache)
then we'll apply it after a review

bugtracker is issues.apache.org/jira/browse/TOMEE

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/1/9 BKumar <bi...@creditpointe.com>

> Is it possible to get a fix for this soon. Do I need to  create JIRA for
> this? Actually  I  am  new to this forum.
>
> Thanks,
> Bibhuti
>
>
>
>
> --
> 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-tp4660196p4660201.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: How to tell openejb to use only supplied orm over generated for CMP2.1

Posted by BKumar <bi...@creditpointe.com>.
Is it possible to get a fix for this soon. Do I need to  create JIRA for
this? Actually  I  am  new to this forum.

Thanks,
Bibhuti




--
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-tp4660196p4660201.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to tell openejb to use only supplied orm over generated for CMP2.1

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

well you probably hit a bug

here is the converter: org.apache.openejb.config.CmpJpaConversion#deploy
and currently you can't skip it

that said i think the generated file mainly helps to convert to JPA cmp2
beans rather than running the app faster

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/1/9 BKumar <bi...@creditpointe.com>

> 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.
>