0 Replies Latest reply on Jan 12, 2004 3:46 PM by ilker.yuemsek

    invalid object name with sql-server 2000

    ilker.yuemsek Newbie

      Hi,
      I deployed my application in jboss 4.0.0DR2 and with the db MS Sql-server 2000.
      The db runs fine and at the deployement can i see the connections to my db and i see also
      that the tables already exists:

      ...
      [MSSQLDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=MSSQLDS to JNDI name 'java:/MSSQLDS'
      21:43:29,208 INFO [TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=MSSQLDS
      ...
      [OrderCna] Table 'OMG03_ORDERCNA' already exists
      [Order] Table 'OMG00_ORDER' already exists
      [CnaOperation] Table 'OMG05_CNAOPERATION' already exists
      [CompletionNoteArea] Table 'OMG01_COMPLETIONNOTEAREA' already exists
      [RoutingPlan] Table 'OMG04_ROUTINGPLAN' already exists
      ...


      but when i run the client for the appl. and it try to access to any table-content (per finderXXX) i
      get the following error:

      Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]invalid object name 'OMG05_CNAOPERATION'.; CausedByException is:
       null; CausedByException is:
       ...


      i have the db-, ejb-jar- and jboscmp-jdbc- configs and the full-error-entry below attached.

      Where i am wrong?

      Has anyone a suggestion how to solve this problem?

      Kind regards
      Ilker Yuemsek

      the full entry is like below:

      22:12:55,979 INFO [DTXAResourceInterceptor] Creating a new mbean instance on client: jboss.tm:service=XAResourceInterceptor
      22:12:56,119 INFO [InvokerRegistry] Failed to load soap remoting transport: javax/xml/rpc/ServiceException
      No property editor for type: class javax.management.ObjectName, setting value to null rather than jboss.tm:service=TransactionManagerService
      No property editor for type: class javax.management.ObjectName, setting value to null rather than jboss.remoting:service=InterceptorAdapter
      No property editor for type: class javax.management.ObjectName, setting value to null rather than jboss.tm:service=TxLogger
      No property editor for type: class javax.management.ObjectName, setting value to null rather than jboss.tm:service=XidFactory
      No property editor for type: class javax.management.ObjectName, setting value to null rather than jboss.tm:service=TxLogger
      No property editor for type: class javax.management.ObjectName, setting value to null rather than jboss.tm:service=TransactionManagerService
      No property editor for type: class javax.management.ObjectName, setting value to null rather than jboss.jca:service=CachedConnectionManager
      22:12:56,990 INFO [NoLogTxLogger] Started jboss.tm:service=NoLogTxLogger
      22:12:57,000 INFO [JBossXidFactory] Started jboss.tm:service=XidFactory
      22:12:57,040 INFO [TransactionManagerService] Started jboss.tm:service=TransactionManagerService
      22:12:57,040 INFO [UserTransactionImpl] TransactionManagerName is : jboss.tm:service=TransactionManagerService
      22:12:57,100 INFO [UserTransactionImpl] Could not bind UserTransaction, already bound
      22:12:57,100 INFO [UserTransactionImpl] Started jboss.tm:service=UserTransaction
      22:12:57,100 INFO [DTXAResourceInterceptor] Started jboss.tm:service=XAResourceInterceptor
      22:12:57,110 INFO [RemotingAdapter] Creating a new mbean instance on client: jboss.ejb:service=RemotingAdapter
      org.jboss.tm.JBossTransactionRolledbackException: null; CausedByException is:
      Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]invalid object name 'OMG05_CNAOPERATION'.; CausedByException is:
      null; CausedByException is: Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Ungültiger Objektname 'OMG05_CNAOPERATION'.; - nested throwable: (javax.ejb.EJBException: null; CausedByException is:
      Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]invalid object name 'OMG05_CNAOPERATION'.); nested exception is:
      javax.ejb.EJBException: null; CausedByException is:
      Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]invalid object name 'OMG05_CNAOPERATION'.; - nested throwable: (javax.ejb.EJBException: null; CausedByException is:
      Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]invalid object name 'OMG05_CNAOPERATION'.)
      at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:186)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:121)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:102)
      at org.jboss.ejb.Container.invoke(Container.java:1159)
      at org.jboss.ejb.Container.invoke(Container.java:1301)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:72)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:544)
      at org.jboss.invocation.remoting.EJBSubsystemInvocationHandler.invoke(EJBSubsystemInvocationHandler.java:88)
      at org.jboss.remoting.ServerInterceptorChain$InterceptorIterator.invokeNext(ServerInterceptorChain.java:347)
      at org.jboss.tm.DTXAWorkServerInterceptor.invoke(DTXAWorkServerInterceptor.java:129)
      at org.jboss.remoting.ServerInterceptorChain$InterceptorIterator.invokeNext(ServerInterceptorChain.java:347)
      at org.jboss.remoting.ServerInterceptorChain.invoke(ServerInterceptorChain.java:321)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:326)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:250)
      at org.jboss.remoting.transport.socket.SocketServerInvoker$Client.run(SocketServerInvoker.java:208)
      Caused by: javax.ejb.EJBException: null; CausedByException is:
      Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Ungültiger Objektname 'OMG05_CNAOPERATION'.
      at de.siemens.sd.it.facts.om.ejb.OrderCnaManagerBean.setSessionContext(OrderCnaManagerBean.java:632)
      at de.siemens.sd.it.facts.om.ejb.OrderCnaManagerSession.setSessionContext(OrderCnaManagerSession.java:24)
      at org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:39)
      at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:45)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:151)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:34)
      at org.jboss.ejb.plugins.TxSupport.invokeInCallerTx(TxSupport.java:247)
      at org.jboss.ejb.plugins.TxSupport$Required.serverInvoke(TxSupport.java:660)
      at org.jboss.ejb.plugins.TxInterceptorCMT.internalInvoke(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:56)
      at org.jboss.security.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:61)
      at org.jboss.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:54)
      at org.jboss.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:65)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:117)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:102)
      at org.jboss.ejb.Container.invoke(Container.java:1159)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:306)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:111)
      at $Proxy82.create(Unknown Source)
      at de.siemens.sd.it.facts.om.ejb.DistributeOrdersControllerBean.setSessionContext(DistributeOrdersControllerBean.java:306)
      at de.siemens.sd.it.facts.om.ejb.DistributeOrdersControllerSession.setSessionContext(DistributeOrdersControllerSession.java:24)
      at org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:39)
      at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:45)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:151)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:34)
      at org.jboss.ejb.plugins.TxSupport.invokeInOurTx(TxSupport.java:213)
      at org.jboss.ejb.plugins.TxSupport$Required.serverInvoke(TxSupport.java:655)
      at org.jboss.ejb.plugins.TxInterceptorCMT.internalInvoke(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:56)
      at org.jboss.security.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:61)
      at org.jboss.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:54)
      at org.jboss.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:65)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:117)
      ... 13 more

      Here is my db-conf:
      mssql-ds.xml:

      <local-tx-datasource>
       <jndi-name>MSSQLDS</jndi-name>
       <connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=facts;SelectMethod=cursor;ProgramName=DOH</connection-url>
       <DatabaseName>facts</DatabaseName>
       <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
       <user-name>sa</user-name>
       <password>doh2ws</password>
       </local-tx-datasource>


      jbosscmp-jdbc.xml:

      <jbosscmp-jdbc>
       <defaults>
       <datasource>java:/MSSQLDS</datasource>
       <datasource-mapping>MS SQLSERVER2000</datasource-mapping>
       <row-locking>true</row-locking>
       <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
       </defaults>
      
      <enterprise-beans>
       <!--
       To add beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
       that contains the <entity></entity> markup for those beans.
       -->
       <entity>
       <ejb-name>CompletionNoteArea</ejb-name>
       <table-name>OMG01_COMPLETIONNOTEAREA</table-name>
       <cmp-field>
       <field-name>cnaNumber</field-name>
       <column-name>OMG01_CNANUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>startCna</field-name>
       <column-name>OMG01_STARTCNA</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>cnaName</field-name>
       <column-name>OMG01_CNANAME</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>bufferNumber</field-name>
       <column-name>OMG01_BUFFERNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>overDeliveryFactor</field-name>
       <column-name>OMG01_OVERDELIVERYFACTOR</column-name>
       </cmp-field>
       <query>
       <description><![CDATA[ORDER BY wird nur von jboss-ql unterstuetzt aber es muss unbedingt eine aequivalente ejb.finder definiert sein. Dies wird dann spaeter ueberschrieben]]></description>
       <query-method>
       <method-name>findAll</method-name>
       <method-params/>
       </query-method>
       <jboss-ql><![CDATA[SELECT OBJECT(a) FROM cnabean a ORDER BY a.cnaName ASC]]></jboss-ql>
       </query>
       </entity>
       <entity>
       <ejb-name>RoutingPlan</ejb-name>
       <table-name>OMG04_ROUTINGPLAN</table-name>
       <cmp-field>
       <field-name>operationNumber</field-name>
       <column-name>OMG04_OPERATIONNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>sequence</field-name>
       <column-name>OMG04_SEQUENCE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>initiated</field-name>
       <column-name>OMG04_INITIATED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>completed</field-name>
       <column-name>OMG04_COMPLETED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>scrapped</field-name>
       <column-name>OMG04_SCRAPPED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>sentToErp</field-name>
       <column-name>OMG04_SENTTOERP</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>workplace</field-name>
       <column-name>OMG04_WORKPLACE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>orderNumber</field-name>
       <column-name>OMG04_ORDERNUMBER</column-name>
       </cmp-field>
       </entity>
       <entity>
       <ejb-name>CnaOperation</ejb-name>
       <table-name>OMG05_CNAOPERATION</table-name>
       <cmp-field>
       <field-name>cnaNumber</field-name>
       <column-name>OMG05_CNANUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>operationNumber</field-name>
       <column-name>OMG05_WORKPLACE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>sequence</field-name>
       <column-name>OMG05_SEQUENCE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>initiateOperation</field-name>
       <column-name>OMG05_INITIATEOPERATION</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>completeOperation</field-name>
       <column-name>OMG05_COMPLETEOPERATION</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>accountOperation</field-name>
       <column-name>OMG05_ACCOUNTOPERATION</column-name>
       </cmp-field>
       <query>
       <description><![CDATA[selects the count of the sequences in a routingplan, that belong to the given order. The sequences must be less as given sequence (minimum complete sequence) and the workplaces must be exist in the given Collection of workplaces. The operation number of the routingplan may not be included in the given operation numbers.]]></description>
       <query-method>
       <method-name>ejbSelectOrderOpSequencesBySequenceAndWP</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <dynamic-ql/>
       </query>
       <query>
       <description><![CDATA[Selects the next complete operation in the routingplan, that is for the self order number defined, whose workplace is equal with the given workplace and whose operation number is not included in the given operation numbers]]></description>
       <query-method>
       <method-name>ejbSelectNextCompleteOperation</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <dynamic-ql/>
       </query>
       <query>
       <description><![CDATA[Selects the sequences of the routingplans, that are defined for the self order number, whose sequences are lesser (or equal) as (with) the given sequence and whose operation number are not included in the given operation number.]]></description>
       <query-method>
       <method-name>ejbSelectOrderOperationSequencesBySequenceAndOpNr</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <dynamic-ql/>
       </query>
       <query>
       <description><![CDATA[Selects the Cna-Operations, if whose CNA is defined as start-CNA, they're defined as complete operation and it exists a routingplan for the self order number, thats operation number is not included in the given operation numbers and that's workplace is equal with the operation number of the Cna-Operation.]]></description>
       <query-method>
       <method-name>ejbSelectCnaOpByCompleteOpWPAndOpNr</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <dynamic-ql/>
       </query>
       </entity>
       <entity>
       <ejb-name>OrderCna</ejb-name>
       <table-name>OMG03_ORDERCNA</table-name>
       <cmp-field>
       <field-name>orderNumber</field-name>
       <column-name>OMG03_ORDERNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>cnaNumber</field-name>
       <column-name>OMG03_CNANUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>sequence</field-name>
       <column-name>OMG03_SEQUENCE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>workOnHand</field-name>
       <column-name>OMG03_WORKONHAND</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>initiated</field-name>
       <column-name>OMG03_INITIATED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>completed</field-name>
       <column-name>OMG03_COMPLETED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>scrapped</field-name>
       <column-name>OMG03_SCRAPPED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>level</field-name>
       <column-name>OMG03_LEVEL</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>completeOperationNumber</field-name>
       <column-name>OMG03_COMPLETEOPERATIONNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>panel</field-name>
       <column-name>OMG03_PANEL</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>passes</field-name>
       <column-name>OMG03_PASSES</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>registered</field-name>
       <column-name>OMG03_REGISTERED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>overDeliveryFactor</field-name>
       <column-name>OMG03_OVERDELIVERYFACTOR</column-name>
       </cmp-field>
       <!--
       <query>
       <description><![CDATA[findPrevOrder wird durch diese Abfrage auf solcherweise ersetzt, dass als Parameter der Wert level dekrementiert wird: _@ejb.finder signature='java.util.Collection findPrevOrderCna (java.lang.String orderNumber, int level)' _@jboss.query query='SELECT OBJECT(a) FROM ordercna a WHERE a.orderNumber=?1 AND (a.level + 1 = ?2)' signature='java.util.Collection findPrevOrderCna (java.lang.String orderNumber, int level)']]></description>
       <query-method>
       <method-name>findByOrderNumberLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <jboss-ql><![CDATA[SELECT OBJECT(a) FROM ordercna a WHERE a.orderNumber = ?1 AND a.level = ?2]]></jboss-ql>
      
       </query>
       -->
       <query>
       <query-method>
       <method-name>ejbSelectOrderForCompletionByCna</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <jboss-ql><![CDATA[SELECT OBJECT(oc) FROM ordercna oc WHERE oc.cnaNumber = ?1 AND oc.order.closed = FALSE ORDER BY oc.order.priority, oc.order.finishDate, oc.order.materialNumber, oc.order.orderNumber ASC]]></jboss-ql>
       </query>
       </entity>
       <entity>
       <ejb-name>Order</ejb-name>
       <table-name>OMG00_ORDER</table-name>
       <cmp-field>
       <field-name>orderNumber</field-name>
       <column-name>OMG00_ORDERNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>materialNumber</field-name>
       <column-name>OMG00_MATERIALNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>productNumber</field-name>
       <column-name>OMG00_PRODUCTNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>orderQuantity</field-name>
       <column-name>OMG00_ORDERQUANTITY</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>plannedScrapQuantity</field-name>
       <column-name>OMG00_PLANNEDSCRAPQUANTITY</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>unit</field-name>
       <column-name>OMG00_UNIT</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>priority</field-name>
       <column-name>OMG00_PRIORITY</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>startDate</field-name>
       <column-name>OMG00_STARTDATE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>finishDate</field-name>
       <column-name>OMG00_FINISHDATE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>receivingPlant</field-name>
       <column-name>OMG00_RECEIVINGPLANT</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>receivingStorage</field-name>
       <column-name>OMG00_RECEIVINGSTORAGE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>externalOrderNumber</field-name>
       <column-name>OMG00_EXTERNALORDERNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>externalOrderPosition</field-name>
       <column-name>OMG00_EXTERNALORDERPOSITION</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>customerOrderNumber</field-name>
       <column-name>OMG00_CUSTOMERORDERNUMBER</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>serialNumberRange</field-name>
       <column-name>OMG00_SERIALNUMBERRANGE</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>completed</field-name>
       <column-name>OMG00_COMPLETED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>scrapped</field-name>
       <column-name>OMG00_SCRAPPED</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>closed</field-name>
       <column-name>OMG00_CLOSED</column-name>
       </cmp-field>
       <query>
       <query-method>
       <method-name>ejbSelectNotClosedOrderCNAsByOrderQuantity</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <jboss-ql><![CDATA[SELECT OBJECT(oc) FROM orderbean o, IN(o.orderCNAs) oc WHERE oc.cnaNumber = ?1 AND o.closed =FALSE AND (o.orderQuantity > (o.completed + o.scrapped)) ORDER BY o.priority ASC, o.finishDate ASC, o.materialNumber ASC, o.orderNumber ASC]]></jboss-ql>
       </query>
       </entity>
       </enterprise-beans>
       <relationships>
       <ejb-relation>
       <ejb-relation-name>CnaOperationOfTheCNARelation</ejb-relation-name>
       <foreign-key-mapping/>
       <ejb-relationship-role>
       <ejb-relationship-role-name>CnaOperationNeedsCNAs</ejb-relationship-role-name>
       <fk-constraint>true</fk-constraint>
       <key-fields/>
       </ejb-relationship-role>
       <ejb-relationship-role>
       <ejb-relationship-role-name>CNAIsInCnaOperationIncluded</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>cnaNumber</field-name>
       <column-name>cna</column-name>
       </key-field>
       </key-fields>
       </ejb-relationship-role>
       </ejb-relation>
       <ejb-relation>
       <ejb-relation-name>OrderCNAOfTheCNARelation</ejb-relation-name>
       <foreign-key-mapping/>
       <ejb-relationship-role>
       <ejb-relationship-role-name>OrderCNANeedsCNAs</ejb-relationship-role-name>
       <fk-constraint>true</fk-constraint>
       <key-fields/>
       </ejb-relationship-role>
       <ejb-relationship-role>
       <ejb-relationship-role-name>CNAIsInOrderCNAIncluded</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>cnaNumber</field-name>
       <column-name>cna</column-name>
       </key-field>
       </key-fields>
       </ejb-relationship-role>
       </ejb-relation>
       <ejb-relation>
       <ejb-relation-name>RoutingPlanOfTheOrderRelation</ejb-relation-name>
       <foreign-key-mapping/>
       <ejb-relationship-role>
       <ejb-relationship-role-name>RoutingPlanInAnOrder</ejb-relationship-role-name>
       <fk-constraint>true</fk-constraint>
       <key-fields/>
       </ejb-relationship-role>
       <ejb-relationship-role>
       <ejb-relationship-role-name>OrderHasRoutingPlans</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>orderNumber</field-name>
       <column-name>order</column-name>
       </key-field>
       </key-fields>
       </ejb-relationship-role>
       </ejb-relation>
       <ejb-relation>
       <ejb-relation-name>OrderCNAOfTheOrderRelation</ejb-relation-name>
       <foreign-key-mapping/>
       <ejb-relationship-role>
       <ejb-relationship-role-name>OrderCNAsInAnOrder</ejb-relationship-role-name>
       <fk-constraint>true</fk-constraint>
       <key-fields/>
       </ejb-relationship-role>
       <ejb-relationship-role>
       <ejb-relationship-role-name>OrderHasCNAs</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>orderNumber</field-name>
       <column-name>order</column-name>
       </key-field>
       </key-fields>
       </ejb-relationship-role>
       </ejb-relation>
       </relationships>

      ejb-jar.xml:

      <ejb-jar >
      
       <description><![CDATA[No Description.]]></description>
       <display-name>Generated by XDoclet</display-name>
      
       <enterprise-beans>
      
       <!-- Session Beans -->
       <session >
       <description><![CDATA[]]></description>
      
       <ejb-name>OrderCnaManager</ejb-name>
      
       <home>de.siemens.sd.it.facts.om.ejb.OrderCnaManagerHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.OrderCnaManager</remote>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderCnaManagerLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderCnaManagerLocal</local>
       <ejb-class>de.siemens.sd.it.facts.om.ejb.OrderCnaManagerSession</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <ejb-ref >
       <ejb-ref-name>ejb/OrderCna</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <home>de.siemens.sd.it.facts.om.ejb.OrderCnaHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.OrderCna</remote>
       <ejb-link>OrderCna</ejb-link>
       </ejb-ref>
       <ejb-ref >
       <ejb-ref-name>ejb/CnaOperation</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <home>de.siemens.sd.it.facts.om.ejb.CnaOperationHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.CnaOperation</remote>
       <ejb-link>CnaOperation</ejb-link>
       </ejb-ref>
       <ejb-ref >
       <ejb-ref-name>ejb/CompletionNoteArea</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <home>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaHome</home>
       <remote>de.siemens.sd.it.facts.global.ejb.CompletionNoteArea</remote>
       <ejb-link>CompletionNoteArea</ejb-link>
       </ejb-ref>
      
       <ejb-local-ref >
       <ejb-ref-name>ejb/OrderCnaLocal</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderCnaLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderCnaLocal</local>
       <ejb-link>OrderCna</ejb-link>
       </ejb-local-ref>
       <ejb-local-ref >
       <ejb-ref-name>ejb/OrderLocal</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderLocal</local>
       <ejb-link>Order</ejb-link>
       </ejb-local-ref>
       <ejb-local-ref >
       <ejb-ref-name>ejb/CnaOperationLocal</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.om.ejb.CnaOperationLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.CnaOperationLocal</local>
       <ejb-link>CnaOperation</ejb-link>
       </ejb-local-ref>
       <ejb-local-ref >
       <ejb-ref-name>ejb/CompletionNoteAreaLocal</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaLocalHome</local-home>
       <local>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaLocal</local>
       <ejb-link>CompletionNoteArea</ejb-link>
       </ejb-local-ref>
      
       </session>
      
       <session >
       <description><![CDATA[]]></description>
      
       <ejb-name>OrderManager</ejb-name>
      
       <home>de.siemens.sd.it.facts.om.ejb.OrderManagerHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.OrderManager</remote>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderManagerLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderManagerLocal</local>
       <ejb-class>de.siemens.sd.it.facts.om.ejb.OrderManagerSession</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <ejb-ref >
       <ejb-ref-name>ejb/Order</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <home>de.siemens.sd.it.facts.om.ejb.OrderHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.Order</remote>
       <ejb-link>Order</ejb-link>
       </ejb-ref>
       <ejb-ref >
       <ejb-ref-name>ejb/RoutingPlan</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <home>de.siemens.sd.it.facts.om.ejb.RoutingPlanHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.RoutingPlan</remote>
       <ejb-link>RoutingPlan</ejb-link>
       </ejb-ref>
      
       <ejb-local-ref >
       <ejb-ref-name>ejb/OrderLocal</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderLocal</local>
       <ejb-link>Order</ejb-link>
       </ejb-local-ref>
       <ejb-local-ref >
       <ejb-ref-name>ejb/RoutingPlanLocal</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.om.ejb.RoutingPlanLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.RoutingPlanLocal</local>
       <ejb-link>RoutingPlan</ejb-link>
       </ejb-local-ref>
      
       </session>
      
       <session >
       <description><![CDATA[]]></description>
      
       <ejb-name>DistributeOrdersController</ejb-name>
      
       <home>de.siemens.sd.it.facts.om.ejb.DistributeOrdersControllerHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.DistributeOrdersController</remote>
       <local-home>de.siemens.sd.it.facts.om.ejb.DistributeOrdersControllerLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.DistributeOrdersControllerLocal</local>
       <ejb-class>de.siemens.sd.it.facts.om.ejb.DistributeOrdersControllerSession</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <ejb-ref >
       <ejb-ref-name>ejb/CompletionNoteArea</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <home>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaHome</home>
       <remote>de.siemens.sd.it.facts.global.ejb.CompletionNoteArea</remote>
       <ejb-link>CompletionNoteArea</ejb-link>
       </ejb-ref>
       <ejb-ref >
       <ejb-ref-name>ejb/OrderManager</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>de.siemens.sd.it.facts.om.ejb.OrderManagerHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.OrderManager</remote>
       <ejb-link>OrderManager</ejb-link>
       </ejb-ref>
       <ejb-ref >
       <ejb-ref-name>ejb/OrderCnaManager</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>de.siemens.sd.it.facts.om.ejb.OrderCnaManagerHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.OrderCnaManager</remote>
       <ejb-link>OrderCnaManager</ejb-link>
       </ejb-ref>
      
       <ejb-local-ref >
       <ejb-ref-name>ejb/CompletionNoteAreaLocal</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaLocalHome</local-home>
       <local>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaLocal</local>
       <ejb-link>CompletionNoteArea</ejb-link>
       </ejb-local-ref>
       <ejb-local-ref >
       <ejb-ref-name>ejb/OrderManagerLocal</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderManagerLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderManagerLocal</local>
       <ejb-link>OrderManager</ejb-link>
       </ejb-local-ref>
       <ejb-local-ref >
       <ejb-ref-name>ejb/OrderCnaManagerLocal</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderCnaManagerLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderCnaManagerLocal</local>
       <ejb-link>OrderCnaManager</ejb-link>
       </ejb-local-ref>
      
       </session>
      
       <!--
       To add session beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called session-beans.xml that contains
       the <session></session> markup for those beans.
       -->
      
       <!-- Entity Beans -->
       <entity >
       <description><![CDATA[<b><code>CompletionNoteAreaBean</code></b>]]></description>
      
       <ejb-name>CompletionNoteArea</ejb-name>
      
       <home>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaHome</home>
       <remote>de.siemens.sd.it.facts.global.ejb.CompletionNoteArea</remote>
       <local-home>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaLocalHome</local-home>
       <local>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaLocal</local>
      
       <ejb-class>de.siemens.sd.it.facts.global.ejb.CompletionNoteAreaCMP</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>java.lang.String</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>cnabean</abstract-schema-name>
       <cmp-field >
       <description><![CDATA[Returns the cnaNumber]]></description>
       <field-name>cnaNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the startCna]]></description>
       <field-name>startCna</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the cnaName]]></description>
       <field-name>cnaName</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the bufferNumber]]></description>
       <field-name>bufferNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the overDeliveryFactor]]></description>
       <field-name>overDeliveryFactor</field-name>
       </cmp-field>
       <primkey-field>cnaNumber</primkey-field>
       <query>
       <query-method>
       <method-name>findAllStartCNAs</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(a) FROM cnabean a WHERE a.startCna=TRUE]]></ejb-ql>
       </query>
      
       <!-- Write a file named ejb-finders-CompletionNoteAreaBean.xml if you want to define extra finders. -->
       </entity>
      
       <entity >
       <description><![CDATA[]]></description>
      
       <ejb-name>RoutingPlan</ejb-name>
      
       <home>de.siemens.sd.it.facts.om.ejb.RoutingPlanHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.RoutingPlan</remote>
       <local-home>de.siemens.sd.it.facts.om.ejb.RoutingPlanLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.RoutingPlanLocal</local>
      
       <ejb-class>de.siemens.sd.it.facts.om.ejb.RoutingPlanCMP</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>de.siemens.sd.it.facts.om.ejb.RoutingPlanPK</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>routingplan</abstract-schema-name>
       <cmp-field >
       <description><![CDATA[Returns the operationNumber]]></description>
       <field-name>operationNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the sequence]]></description>
       <field-name>sequence</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the initiated]]></description>
       <field-name>initiated</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the completed]]></description>
       <field-name>completed</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the scrapped]]></description>
       <field-name>scrapped</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the sentToErp]]></description>
       <field-name>sentToErp</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the workPlace]]></description>
       <field-name>workplace</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the workPlace]]></description>
       <field-name>orderNumber</field-name>
       </cmp-field>
      
       <query>
       <query-method>
       <method-name>findAll</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(a) FROM routingplan a]]></ejb-ql>
       </query>
       <query>
       <query-method>
       <method-name>findByOrderLocal</method-name>
       <method-params>
       <method-param>de.siemens.sd.it.facts.om.ejb.OrderLocal</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(r) FROM routingplan r WHERE r.order = ?1]]></ejb-ql>
       </query>
       <query>
       <query-method>
       <method-name>findNotSentToErp</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(r) FROM routingplan r WHERE r.sentToErp = FALSE]]></ejb-ql>
       </query>
       <!-- Write a file named ejb-finders-RoutingPlanBean.xml if you want to define extra finders. -->
       </entity>
      
       <entity >
       <description><![CDATA[]]></description>
      
       <ejb-name>CnaOperation</ejb-name>
      
       <home>de.siemens.sd.it.facts.om.ejb.CnaOperationHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.CnaOperation</remote>
       <local-home>de.siemens.sd.it.facts.om.ejb.CnaOperationLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.CnaOperationLocal</local>
      
       <ejb-class>de.siemens.sd.it.facts.om.ejb.CnaOperationCMP</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>de.siemens.sd.it.facts.om.vo.CnaOperationPK</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>cnaoperation</abstract-schema-name>
       <cmp-field >
       <description><![CDATA[Returns the cnaNumber]]></description>
       <field-name>cnaNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the operationNumber]]></description>
       <field-name>operationNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the sequence]]></description>
       <field-name>sequence</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the initiateOperation]]></description>
       <field-name>initiateOperation</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the completeOperation]]></description>
       <field-name>completeOperation</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the accountOperation]]></description>
       <field-name>accountOperation</field-name>
       </cmp-field>
      
       <query>
       <query-method>
       <method-name>findAll</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(a) FROM cnaoperation a]]></ejb-ql>
       </query>
       <query>
       <query-method>
       <method-name>findCnaOperations</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(a) FROM cnaoperation a WHERE a.cnaNumber = ?1]]></ejb-ql>
       </query>
       <query>
       <query-method>
       <method-name>findInitiated</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(a) FROM cnaoperation a WHERE a.initiateOperation = TRUE]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectCompleteOperationSequenceByWorkplace</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT rp.sequence FROM routingplan rp WHERE rp.orderNumber = ?1 AND rp.workplace = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[<p> The dynamic query-method for]]></description>
       <query-method>
       <method-name>ejbSelectOrderOpSequencesBySequenceAndWP</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[<p> The dynamic query-method for @link #ejbHomeSelectCnaOpByCompleteOpWPAndOpNr </p>]]></description>
       <query-method>
       <method-name>ejbSelectCnaOpByCompleteOpWPAndOpNr</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[<p> The dynamic query-method for]]></description>
       <query-method>
       <method-name>ejbSelectOrderOperationSequencesBySequenceAndOpNr</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[<p> dynamic query-method for]]></description>
       <query-method>
       <method-name>ejbSelectNextCompleteOperation</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectCompleteWorkplaceByCnaNumber</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT co.operationNumber FROM cnaoperation co WHERE co.completeOperation = TRUE AND co.cnaNumber = ?1]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectOperationSequencesBySequence</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT rp.sequence FROM routingplan rp WHERE rp.orderNumber = ?1 AND rp.sequence <= ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectCnaOperationByCompleteOperationWorkplace</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT OBJECT(co) FROM cnabean c, routingplan rp, IN(c.cnaOperations) co WHERE c.startCna=TRUE AND co.completeOperation=TRUE AND rp.orderNumber=?1 AND co.operationNumber = rp.workplace]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectOrderCnaByCnaAndOrder</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT OBJECT(oc) FROM cnabean c, IN(c.orderCNAs) oc WHERE c.cnaNumber = ?1 AND oc.orderNumber = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectCompleteOperationNumberByOrderAndLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT oc.completeOperationNumber FROM ordercna oc WHERE oc.orderNumber = ?1 AND oc.level < ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectOperationWorkplacesByCnaNumber</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT co.operationNumber FROM cnabean c, IN(c.cnaOperations) co WHERE c.cnaNumber = ?1]]></ejb-ql>
       </query>
       <!-- Write a file named ejb-finders-CnaOperationBean.xml if you want to define extra finders. -->
       </entity>
      
       <entity >
       <description><![CDATA[]]></description>
      
       <ejb-name>OrderCna</ejb-name>
      
       <home>de.siemens.sd.it.facts.om.ejb.OrderCnaHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.OrderCna</remote>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderCnaLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderCnaLocal</local>
      
       <ejb-class>de.siemens.sd.it.facts.om.ejb.OrderCnaCMP</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>de.siemens.sd.it.facts.om.vo.OrderCnaPK</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>ordercna</abstract-schema-name>
       <cmp-field >
       <description><![CDATA[Returns the orderNumber]]></description>
       <field-name>orderNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the cnaNumber]]></description>
       <field-name>cnaNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the sequence]]></description>
       <field-name>sequence</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the workOnHand]]></description>
       <field-name>workOnHand</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the initiated]]></description>
       <field-name>initiated</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the completed]]></description>
       <field-name>completed</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the scrapped]]></description>
       <field-name>scrapped</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the level]]></description>
       <field-name>level</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the completeOperationNumber]]></description>
       <field-name>completeOperationNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the panel]]></description>
       <field-name>panel</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the passes]]></description>
       <field-name>passes</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the registered]]></description>
       <field-name>registered</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the overDeliveryFactor]]></description>
       <field-name>overDeliveryFactor</field-name>
       </cmp-field>
      
       <query>
       <description><![CDATA[Must be changed as MAX(oc.sequence) when implementable]]></description>
       <query-method>
       <method-name>findSequenceByOrderNumber</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT oc.sequence FROM ordercna AS oc WHERE oc.orderNumber = ?1]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[Must be changed as SUM(oc.scrapped) when implementable]]></description>
       <query-method>
       <method-name>findScrappedByOrderNumber</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT oc.scrapped FROM ordercna AS oc WHERE oc.orderNumber = ?1]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectOrderForCompletion</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT OBJECT(oc) FROM ordercna AS oc WHERE oc.orderNumber = ?1 AND oc.cnaNumber = ?2 AND oc.order.closed = FALSE]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[<p> Selects the orderCna-instance by pk and if order is not closed </p>]]></description>
       <query-method>
       <method-name>ejbSelectOrderForCompletionByCna</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectCompletedByOrderNumberAndLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT a.completed FROM ordercna AS a WHERE a.orderNumber = ?1 AND a.level = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectScrappedByOrderNumberAndLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT a.scrapped FROM ordercna AS a WHERE a.orderNumber = ?1 AND a.level = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[findPrevOrder wird durch diese Abfrage auf solcherweise ersetzt, dass als Parameter der Wert level dekrementiert wird: _@ejb.finder signature='java.util.Collection findPrevOrderCna (java.lang.String orderNumber, int level)' _@jboss.query query='SELECT OBJECT(a) FROM ordercna a WHERE a.orderNumber=?1 AND (a.level + 1 = ?2)' signature='java.util.Collection findPrevOrderCna (java.lang.String orderNumber, int level)']]></description>
       <query-method>
       <method-name>findByOrderNumberLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(a) FROM ordercna a WHERE a.orderNumber = ?1 AND a.level = ?2]]></ejb-ql>
      
       </query>
       <!-- Write a file named ejb-finders-OrderCnaBean.xml if you want to define extra finders. -->
       </entity>
      
       <entity >
       <description><![CDATA[]]></description>
      
       <ejb-name>Order</ejb-name>
      
       <home>de.siemens.sd.it.facts.om.ejb.OrderHome</home>
       <remote>de.siemens.sd.it.facts.om.ejb.Order</remote>
       <local-home>de.siemens.sd.it.facts.om.ejb.OrderLocalHome</local-home>
       <local>de.siemens.sd.it.facts.om.ejb.OrderLocal</local>
      
       <ejb-class>de.siemens.sd.it.facts.om.ejb.OrderCMP</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>java.lang.String</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>orderbean</abstract-schema-name>
       <cmp-field >
       <description><![CDATA[Returns the orderNumber]]></description>
       <field-name>orderNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the materialNumber]]></description>
       <field-name>materialNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the productNumber]]></description>
       <field-name>productNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the orderQuantity]]></description>
       <field-name>orderQuantity</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the plannedScrapQuantity]]></description>
       <field-name>plannedScrapQuantity</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the unit]]></description>
       <field-name>unit</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the priority]]></description>
       <field-name>priority</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the startDate]]></description>
       <field-name>startDate</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the finishDate]]></description>
       <field-name>finishDate</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the receivingPlant]]></description>
       <field-name>receivingPlant</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the receivingStorage]]></description>
       <field-name>receivingStorage</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the externalOrderNumber]]></description>
       <field-name>externalOrderNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the externalOrderPosition]]></description>
       <field-name>externalOrderPosition</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the customerOrderNumber]]></description>
       <field-name>customerOrderNumber</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the serialNumberRange]]></description>
       <field-name>serialNumberRange</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the completed]]></description>
       <field-name>completed</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the scrapped]]></description>
       <field-name>scrapped</field-name>
       </cmp-field>
       <cmp-field >
       <description><![CDATA[Returns the closed]]></description>
       <field-name>closed</field-name>
       </cmp-field>
       <primkey-field>orderNumber</primkey-field>
      
       <query>
       <query-method>
       <method-name>findAll</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(a) FROM orderbean a]]></ejb-ql>
       </query>
       <query>
       <query-method>
       <method-name>findAllOrdersOnHand</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(o) FROM orderbean o WHERE o.closed=FALSE AND o.orderCNAs IS EMPTY]]></ejb-ql>
       </query>
       <query>
       <query-method>
       <method-name>findWhichRoutingPlanNotSentToErp</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[SELECT OBJECT(o) FROM orderbean o, IN (o.routingPlans) rp WHERE rp.sentToErp=FALSE]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectOrderCnaLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT oc.level FROM orderbean o, IN (o.orderCNAs) oc WHERE o.orderNumber = ?1 AND oc.cnaNumber = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectInitiatedByLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT oc.initiated FROM orderbean o, IN (o.orderCNAs) oc WHERE o.orderNumber = ?1 AND oc.level = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectScrappedByOrderNrAndLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT oc.scrapped FROM orderbean o, IN (o.orderCNAs) oc WHERE o.orderNumber = ?1 AND oc.level = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[]]></description>
       <query-method>
       <method-name>ejbSelectCompletedByOrderNrAndLevel</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>int</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[SELECT oc.completed FROM orderbean o, IN (o.orderCNAs) oc WHERE o.orderNumber = ?1 AND oc.level = ?2]]></ejb-ql>
       </query>
       <query>
       <description><![CDATA[<p> Selects not closed order cna's by cnaNumber and OrderQuantity </p>]]></description>
       <query-method>
       <method-name>ejbSelectNotClosedOrderCNAsByOrderQuantity</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <ejb-ql><![CDATA[]]></ejb-ql>
       </query>
       <!-- Write a file named ejb-finders-OrderBean.xml if you want to define extra finders. -->
       </entity>
      
       <!--
       To add entity beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called entity-beans.xml that contains
       the <entity></entity> markup for those beans.
       -->
      
       <!-- Message Driven Beans -->
       <!--
       To add message driven beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called message-driven-beans.xml that contains
       the <message-driven></message-driven> markup for those beans.
       -->
      
       </enterprise-beans>
      
       <!-- Relationships -->
       <relationships >
       <ejb-relation >
       <ejb-relation-name>CnaOperationOfTheCNARelation</ejb-relation-name>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>CnaOperationNeedsCNAs</ejb-relationship-role-name>
       <multiplicity>Many</multiplicity>
       <relationship-role-source >
       <ejb-name>CnaOperation</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>cna</cmr-field-name>
       </cmr-field>
       </ejb-relationship-role>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>CNAIsInCnaOperationIncluded</ejb-relationship-role-name>
       <multiplicity>One</multiplicity>
       <relationship-role-source >
       <ejb-name>CompletionNoteArea</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>cnaOperations</cmr-field-name>
       <cmr-field-type>java.util.Collection</cmr-field-type>
       </cmr-field>
       </ejb-relationship-role>
      
       </ejb-relation>
       <ejb-relation >
       <ejb-relation-name>OrderCNAOfTheCNARelation</ejb-relation-name>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>OrderCNANeedsCNAs</ejb-relationship-role-name>
       <multiplicity>Many</multiplicity>
       <relationship-role-source >
       <ejb-name>OrderCna</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>cna</cmr-field-name>
       </cmr-field>
       </ejb-relationship-role>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>CNAIsInOrderCNAIncluded</ejb-relationship-role-name>
       <multiplicity>One</multiplicity>
       <relationship-role-source >
       <ejb-name>CompletionNoteArea</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>orderCNAs</cmr-field-name>
       <cmr-field-type>java.util.Collection</cmr-field-type>
       </cmr-field>
       </ejb-relationship-role>
      
       </ejb-relation>
       <ejb-relation >
       <ejb-relation-name>Ro