Sounds like the database you are using does not support a type called "int" which you are mapping all "Integer"s to. You need to instead have Integer mapped to some 4-byte wide integer value supported, so you would have to check your database documentation for such a type.
 
Anyways, according to the specification, you should fill out the cmp-version field with 2.x, not 2.0.
 
 
Hope this gets you going
 
Randahl
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of fresnaULL
Sent: 5. marts 2001 16:08
To: Orion-Interest
Subject: Again EJB 2.0

Hi,
I have the following entity beans:
 
person(id(integer), name(varchar))
job(id(integer), name(varchar))
 
So, this is my ejb-jar.xml:
 
 <enterprise-beans>
  <entity>
   <description> Person EJB CMP </description>
   <cmp-version>2.0</cmp-version> 
   <ejb-name>Person</ejb-name>
   <home>person.PersonHome</home>
   <remote>person.Person</remote>
   <ejb-class>person.PersonBean</ejb-class>
   <prim-key-class>java.lang.Integer</prim-key-class>
   <reentrant>False</reentrant>
   <persistence-type>Container</persistence-type>
   <cmp-field><field-name>id</field-name></cmp-field>
   <cmp-field><field-name>name</field-name></cmp-field>   
   <cmp-field><field-name>jobid</field-name></cmp-field>   
   <primkey-field>id</primkey-field>
   </entity>
 </enterprise-beans>
 
 <enterprise-beans>
  <entity>
   <description> Person EJB CMP </description>
   <cmp-version>2.0</cmp-version> 
   <ejb-name>Job</ejb-name>
   <home>JobHome</home>
   <remote>Job</remote>
   <ejb-class>JobBean</ejb-class>
   <prim-key-class>java.lang.Integer</prim-key-class>
   <reentrant>False</reentrant>
   <persistence-type>Container</persistence-type>
   <cmp-field><field-name>id</field-name></cmp-field>
   <cmp-field><field-name>name</field-name></cmp-field>   
   <primkey-field>id</primkey-field>
   </entity>
 </enterprise-beans>
 
    <relationships>
       <ejb-relation>
          <ejb-relation-name>Person-Job</ejb-relation-name>
          <ejb-relationship-role>
             <ejb-relationship-role-name></ejb-relationship-role-name>
             <multiplicity>one</multiplicity>
             <role-source>
                  <ejb-name>Job</ejb-name>
         <remote-ejb-name>Job</remote-ejb-name>
         <dependent-name>Job</dependent-name>        
             </role-source>
             <cmr-field>
                <cmr-field-name>jobid</cmr-field-name>
                <cmr-field-type>Job</cmr-field-type>
             </cmr-field>   
          </ejb-relationship-role>
          <ejb-relationship-role>
             <ejb-relationship-role-name></ejb-relationship-role-name>
             <multiplicity>one</multiplicity>
             <role-source>
                  <ejb-name>Person</ejb-name>
         <remote-ejb-name>Person</remote-ejb-name>
         <dependent-name>Person</dependent-name>                 
             </role-source>
          </ejb-relationship-role>                   
       </ejb-relation>
    </relationships>        
Everything seems to work fine, I mean, the entities get deployed etc... but when I try to create a new
Person Orion seems to map the Integer field to SQLBIG_INT so I get the following error:
[ODBC SQL SERVER DRIVER] Optional feature not implemented
 
In the squema for the sql-server I have the following mapping:
     <type-mapping type="java.lang.Integer" name="int" /> 
but anyway it still replace the Integer by SQLBIG_INT
 
Does anybody know what I'm doing wrong?
 
Thanks in advance.
 
 
 
 

Reply via email to