Avatar billede grave Nybegynder
19. juni 2003 - 00:46 Der er 5 kommentarer og
1 løsning

jboss & CMP field not found

JEg har lavet et par bønner og er nu ved at deploye dem, men app serveren brokker sig med følgende:

Depends On Me: org.jboss.deployment.DeploymentException: CMP field not found : fieldName=department_key, ObjectName: jboss.j2ee:jndiName=local/Departments,service=EJB

jeg syntes ikke lige jeg vil poste 400 linier ejb kode. men:

Jeg har i min ejb-jar.xml et field i Department EJB'en der hedder department_key og det samme i jbosscmp-jdbc.xml, Hvor er det lige den kigger efter department_key for at finde ud af den ikke er der ?? jeg syntes jeg har alt med.
Avatar billede grave Nybegynder
19. juni 2003 - 00:49 #1
det sjove er at alle bønnerne er genereret af JDeveloper, jeg har kun lige lavet jboss.xml og jbosscmp-jdbc.xml

kan det have noget med typerne i basen af gøre ?
Avatar billede arne_v Ekspert
19. juni 2003 - 07:59 #2
Creater bønnen tabellen ? Hvis nej - er feltet der så ?

Du har checket for stave-fejl formoder jeg !

Det kunne måske være interessant at se descriptorerne for den
pågældende bønne (de udsnit af ejb-jar.xml, jboss.xml og jbosscmp-jdbc.xml
som beskriver den pågældende bønne) plus måske lige toppen af koden
til bønnen (package + class + erklæringen af felter).
Avatar billede grave Nybegynder
19. juni 2003 - 09:30 #3
Nej basen er klar...
Jeg har brugt JDeveloper til at generere bønnerne ud fra basen, så jeg har slet ikke rørt bønnerne selv, jeg kommer lige med descriptorne lidt senere..
Avatar billede grave Nybegynder
20. juni 2003 - 17:38 #4
HEr er de:

ejb-jar.xml


<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
  <enterprise-beans>
    <session>
      <description>Session Bean ( Stateless )</description>
      <display-name>MySessionEJB</display-name>
      <ejb-name>MySessionEJB</ejb-name>
      <home>mypackage6.MySessionEJBHome</home>
      <remote>mypackage6.MySessionEJB</remote>
      <ejb-class>mypackage6.impl.MySessionEJBBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
    </session>
    <entity>
      <description>Entity Bean ( CMP )</description>
      <display-name>Status_ids</display-name>
      <ejb-name>Status_ids</ejb-name>
      <local-home>mypackage6.Status_idsLocalHome</local-home>
      <local>mypackage6.Status_idsLocal</local>
      <ejb-class>mypackage6.impl.Status_idsBean</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>Status_ids</abstract-schema-name>
      <cmp-field>
        <field-name>status_id</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>descrip</field-name>
      </cmp-field>
      <primkey-field>status_id</primkey-field>
      <query>
        <query-method>
          <method-name>findAll</method-name>
          <method-params/>
        </query-method>
        <ejb-ql>SELECT OBJECT(o) FROM Status_ids AS o</ejb-ql>
      </query>
    </entity>
    <entity>
      <description>Entity Bean ( CMP )</description>
      <display-name>Departments</display-name>
      <ejb-name>Departments</ejb-name>
      <local-home>mypackage6.DepartmentsLocalHome</local-home>
      <local>mypackage6.DepartmentsLocal</local>
      <ejb-class>mypackage6.impl.DepartmentsBean</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>Departments</abstract-schema-name>
      <cmp-field>
        <field-name>department_key</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>department_name</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>company_name</field-name>
      </cmp-field>
      <primkey-field>department_key</primkey-field>
      <query>
        <query-method>
          <method-name>findAll</method-name>
          <method-params/>
        </query-method>
        <ejb-ql>SELECT OBJECT(o) FROM Departments AS o</ejb-ql>
      </query>
    </entity>
    <entity>
      <description>Entity Bean ( CMP )</description>
      <display-name>Contacts</display-name>
      <ejb-name>Contacts</ejb-name>
      <local-home>mypackage6.ContactsLocalHome</local-home>
      <local>mypackage6.ContactsLocal</local>
      <ejb-class>mypackage6.impl.ContactsBean</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>Contacts</abstract-schema-name>
      <cmp-field>
        <field-name>contact_key</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>first_nm</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>last_nm</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>address</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>zip_code</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>country</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>phone1</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>phone2</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>email</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>age</field-name>
      </cmp-field>
      <primkey-field>contact_key</primkey-field>
      <query>
        <query-method>
          <method-name>findAll</method-name>
          <method-params/>
        </query-method>
        <ejb-ql>SELECT OBJECT(o) FROM Contacts AS o</ejb-ql>
      </query>
    </entity>
    <entity>
      <description>Entity Bean ( CMP )</description>
      <display-name>Groups</display-name>
      <ejb-name>Groups</ejb-name>
      <local-home>mypackage6.GroupsLocalHome</local-home>
      <local>mypackage6.GroupsLocal</local>
      <ejb-class>mypackage6.impl.GroupsBean</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>Groups</abstract-schema-name>
      <cmp-field>
        <field-name>group_key</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>group_name</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>date_add</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>date_avail</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>date_expire</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>status_id</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>descrip</field-name>
      </cmp-field>
      <primkey-field>group_key</primkey-field>
      <query>
        <query-method>
          <method-name>findAll</method-name>
          <method-params/>
        </query-method>
        <ejb-ql>SELECT OBJECT(o) FROM Groups AS o</ejb-ql>
      </query>
    </entity>
    <entity>
      <description>Entity Bean ( CMP )</description>
      <display-name>Groups_join</display-name>
      <ejb-name>Groups_join</ejb-name>
      <local-home>mypackage6.Groups_joinLocalHome</local-home>
      <local>mypackage6.Groups_joinLocal</local>
      <ejb-class>mypackage6.impl.Groups_joinBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>mypackage6.Groups_joinPK</prim-key-class>
      <reentrant>False</reentrant>
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Groups_join</abstract-schema-name>
    </entity>
    <entity>
      <description>Entity Bean ( CMP )</description>
      <display-name>Users</display-name>
      <ejb-name>Users</ejb-name>
      <local-home>mypackage6.UsersLocalHome</local-home>
      <local>mypackage6.UsersLocal</local>
      <ejb-class>mypackage6.impl.UsersBean</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>Users</abstract-schema-name>
      <cmp-field>
        <field-name>user_key</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>username</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>password</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>status_id</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>date_add</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>date_avail</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>date_expire</field-name>
      </cmp-field>
      <primkey-field>user_key</primkey-field>
      <query>
        <query-method>
          <method-name>findAll</method-name>
          <method-params/>
        </query-method>
        <ejb-ql>SELECT OBJECT(o) FROM Users AS o</ejb-ql>
      </query>
    </entity>
    <session>
      <description>Session Bean ( Stateless )</description>
      <display-name>UserFacade</display-name>
      <ejb-name>UserFacade</ejb-name>
      <home>mypackage6.UserFacadeHome</home>
      <remote>mypackage6.UserFacade</remote>
      <ejb-class>mypackage6.impl.UserFacadeBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
    </session>
  </enterprise-beans>
  <relationships>
    <ejb-relation>
      <ejb-relation-name>Contacts - Departments</ejb-relation-name>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Departments may have many Contacts</ejb-relationship-role-name>
        <multiplicity>One</multiplicity>
        <relationship-role-source>
          <ejb-name>Departments</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>contacts_department_key</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Contacts may have one Departments</ejb-relationship-role-name>
        <multiplicity>Many</multiplicity>
        <relationship-role-source>
          <ejb-name>Contacts</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>departments_department_key</cmr-field-name>
        </cmr-field>
      </ejb-relationship-role>
    </ejb-relation>
    <ejb-relation>
      <ejb-relation-name>Groups_join - Groups</ejb-relation-name>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Groups may have many Groups_join</ejb-relationship-role-name>
        <multiplicity>One</multiplicity>
        <relationship-role-source>
          <ejb-name>Groups</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>groups_join_group_key</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Groups_join has one Groups</ejb-relationship-role-name>
        <multiplicity>Many</multiplicity>
        <relationship-role-source>
          <ejb-name>Groups_join</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>groups_group_key</cmr-field-name>
        </cmr-field>
      </ejb-relationship-role>
    </ejb-relation>
    <ejb-relation>
      <ejb-relation-name>Groups_join - Users</ejb-relation-name>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Users may have many Groups_join</ejb-relationship-role-name>
        <multiplicity>One</multiplicity>
        <relationship-role-source>
          <ejb-name>Users</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>groups_join_user_key</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Groups_join may have one Users</ejb-relationship-role-name>
        <multiplicity>Many</multiplicity>
        <relationship-role-source>
          <ejb-name>Groups_join</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>users_user_key</cmr-field-name>
        </cmr-field>
      </ejb-relationship-role>
    </ejb-relation>
    <ejb-relation>
      <ejb-relation-name>Users - Contacts</ejb-relation-name>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Contacts may have many Users</ejb-relationship-role-name>
        <multiplicity>One</multiplicity>
        <relationship-role-source>
          <ejb-name>Contacts</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>users_contact_key</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
        <ejb-relationship-role-name>Users has one Contacts</ejb-relationship-role-name>
        <multiplicity>Many</multiplicity>
        <relationship-role-source>
          <ejb-name>Users</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>contacts_contact_key</cmr-field-name>
        </cmr-field>
      </ejb-relationship-role>
    </ejb-relation>
  </relationships>
</ejb-jar>





jbosscmp-jdbc.xml


<jbosscmp-jdbc>
  <defaults>
      <datasource>java:/SapdbDS</datasource>
      <datasource-mapping>SapDB</datasource-mapping>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
  </defaults>
  <enterprise-beans>
      <entity>
        <ejb-name>Status_ids</ejb-name>
        <table-name>status_ids</table-name>
        <cmp-field>
            <field-name>status_id</field-name>
            <column-name>status_id</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>descrip</field-name>
            <column-name>descrip</column-name>
        </cmp-field>
      </entity>
      <entity>
        <ejb-name>Departments</ejb-name>
        <table-name>departments</table-name>
        <cmp-field>
            <field-name>department_key</field-name>
            <column-name>department_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>department_name</field-name>
            <column-name>department_name</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>company_name</field-name>
            <column-name>company_name</column-name>
        </cmp-field>
      </entity>
      <entity>
        <ejb-name>Contacts</ejb-name>
        <table-name>contacts</table-name>
        <cmp-field>
            <field-name>contact_key</field-name>
            <column-name>contact_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>first_nm</field-name>
            <column-name>first_nm</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>last_nm</field-name>
            <column-name>last_nm</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>address</field-name>
            <column-name>address</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>zip_code</field-name>
            <column-name>zip_code</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>country</field-name>
            <column-name>country</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>phone1</field-name>
            <column-name>phone1</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>phone2</field-name>
            <column-name>phone2</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>email</field-name>
            <column-name>email</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>department_key</field-name>
            <column-name>department_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>age</field-name>
            <column-name>age</column-name>
        </cmp-field>
      </entity>

      <entity>
        <ejb-name>Groups</ejb-name>
        <table-name>groups</table-name>
        <cmp-field>
            <field-name>group_key</field-name>
            <column-name>group_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>group_name</field-name>
            <column-name>group_name</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>date_add</field-name>
            <column-name>date_add</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>date_avail</field-name>
            <column-name>date_avail</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>date_expire</field-name>
            <column-name>date_expire</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>status_id</field-name>
            <column-name>status_id</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>descrip</field-name>
            <column-name>descrip</column-name>
        </cmp-field>
      </entity>
      <entity>
        <ejb-name>Groups_join</ejb-name>
        <table-name>groups_join</table-name>
        <cmp-field>
            <field-name>use_key</field-name>
            <column-name>use_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>group_key</field-name>
            <column-name>group_key</column-name>
        </cmp-field>
      </entity>
    <entity>
        <ejb-name>Users</ejb-name>
        <table-name>users</table-name>
        <cmp-field>
            <field-name>user_key</field-name>
            <column-name>user_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>username</field-name>
            <column-name>username</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>password</field-name>
            <column-name>password</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>contact_key</field-name>
            <column-name>contact_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>group_key</field-name>
            <column-name>group_key</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>status_id</field-name>
            <column-name>status_id</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>date_add</field-name>
            <column-name>date_add</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>date_avail</field-name>
            <column-name>date_avail</column-name>
        </cmp-field>
        <cmp-field>
            <field-name>date_expire</field-name>
            <column-name>date_expire</column-name>
        </cmp-field>
      </entity>
  </enterprise-beans>
</jbosscmp-jdbc>



jboss.xml


<jboss>
    <session>
        <ejb-name>MySessionEJB</ejb-name>
        <ejb-ref>
            <ejb-ref-name>Status_ids</ejb-ref-name>
            <jndi-name>Status_ids</jndi-name>
        </ejb-ref>
    </session>
    <entity>
      <ejb-name>Status_ids</ejb-name>
      <jndi-name>Status_ids</jndi-name>
      <resource-ref>
        <res-ref-name>jdbc/SapdbDS</res-ref-name>
        <resource-name>SapDB</resource-name>
      </resource-ref>
    </entity>
    <entity>
      <ejb-name>Contacts</ejb-name>
      <jndi-name>Contacts</jndi-name>
      <resource-ref>
        <res-ref-name>jdbc/SapdbDS</res-ref-name>
        <resource-name>SapDB</resource-name>
      </resource-ref>
    </entity>
    <entity>
      <ejb-name>Departments</ejb-name>
      <jndi-name>Departments</jndi-name>
      <resource-ref>
        <res-ref-name>jdbc/SapdbD</res-ref-name>
        <resource-name>SapDB</resource-name>
      </resource-ref>
    </entity>
    <entity>
      <ejb-name>Groups</ejb-name>
      <jndi-name>Groups</jndi-name>
      <resource-ref>
        <res-ref-name>jdbc/SapdbDS</res-ref-name>
        <resource-name>SapDB</resource-name>
      </resource-ref>
    </entity>
    <entity>
      <ejb-name>Groups_join</ejb-name>
      <jndi-name>Groups_join</jndi-name>
      <resource-ref>
        <res-ref-name>jdbc/SapdbDS</res-ref-name>
        <resource-name>SapDB</resource-name>
      </resource-ref>
    </entity>
    <entity>
      <ejb-name>Users</ejb-name>
      <jndi-name>Users</jndi-name>
      <resource-ref>
        <res-ref-name>jdbc/SapdbDS</res-ref-name>
        <resource-name>SapDB</resource-name>
      </resource-ref>
    </entity>
</jboss>


package mypackage6.impl;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;

import mypackage6.DepartmentsLocal;
import java.util.Collection;

public abstract class ContactsBean implements EntityBean  {
    private EntityContext context;

    public String ejbCreate(String contact_key, String email) throws CreateException {
        setContact_key(contact_key);
        setEmail(email);
        return contact_key;
    }
.....

package mypackage6.impl;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import java.util.Collection;

public abstract class DepartmentsBean implements EntityBean  {
    private EntityContext context;

    public String ejbCreate(String department_key, String department_name, String company_name) throws CreateException {
        setDepartment_key(department_key);
        setDepartment_name(department_name);
        setCompany_name(company_name);
        return department_key;
    }
.....


package mypackage6.impl;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;

import mypackage6.Groups_joinPK;
import mypackage6.GroupsLocal;
import mypackage6.UsersLocal;

public abstract class Groups_joinBean implements EntityBean  {
    private EntityContext context;

    public Groups_joinPK ejbCreate(UsersLocal users_user_key, GroupsLocal groups_group_key) throws CreateException{
        setUsers_user_key(users_user_key);
        setGroups_group_key(groups_group_key);
        return new Groups_joinPK( users_user_key.getUser_key(), groups_group_key.getGroup_key());
    }

.....


package mypackage6.impl;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import java.sql.Timestamp;
import java.util.Collection;

public abstract class GroupsBean implements EntityBean  {
    private EntityContext context;

    public String ejbCreate(String group_key, String group_name, Timestamp date_add, String status_id) throws CreateException {
        setGroup_key(group_key);
        setGroup_name(group_name);
        setDate_add(date_add);
        setStatus_id(status_id);
        return group_key;
    }
....


package mypackage6.impl;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import java.sql.Timestamp;
import mypackage6.ContactsLocal;
import java.util.Collection;

public abstract class UsersBean implements EntityBean  {
    private EntityContext context;

    public String ejbCreate(String user_key, String username, String password, String status_id, Timestamp date_add, ContactsLocal contacts_contact_key) throws CreateException {
        setUser_key(user_key);
        setUsername(username);
        setPassword(password);
        setStatus_id(status_id);
        setDate_add(date_add);
        setContacts_contact_key(contacts_contact_key);
        return user_key;
    }
.....







package mypackage6;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;

public interface ContactsLocalHome extends EJBLocalHome  {
    ContactsLocal findByPrimaryKey(String primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    ContactsLocal create(String contact_key, String email) throws CreateException;
}
.....


package mypackage6;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;

public interface DepartmentsLocalHome extends EJBLocalHome  {
    DepartmentsLocal findByPrimaryKey(String primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    DepartmentsLocal create(String department_key, String department_name, String company_name) throws CreateException;
}
......



package mypackage6;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;

public interface Groups_joinLocalHome extends EJBLocalHome  {
    Groups_joinLocal findByPrimaryKey(Groups_joinPK primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    Groups_joinLocal create(UsersLocal users_user_key, GroupsLocal groups_group_key) throws CreateException;
}
...



package mypackage6;
import java.io.Serializable;

public class Groups_joinPK implements Serializable  {
    public String group_key;
    public String user_key;

    public Groups_joinPK(String user_key, String group_key) {
        this.user_key = user_key;
        this.group_key = group_key;
    }
    public void setGroup_key(String group_key) {
        this.group_key = group_key;
    }
    public String getGroup_key() {
        return this.group_key;
    }
    public void setUser_key(String user_key) {
        this.user_key = user_key;
    }
    public String getUser_key() {
        return this.user_key;
    }

    public boolean equals(Object other) {
    if (other instanceof Groups_joinPK) {
        final Groups_joinPK otherGroups_joinPK = (Groups_joinPK)other;
        return (group_key.equals(otherGroups_joinPK.group_key) && user_key.equals(otherGroups_joinPK.user_key));
    }
        return false;
    }


    public int hashCode() {
        // Add custom hashCode() impl here
        return group_key.concat(user_key).hashCode();
    }
}
....


package mypackage6;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;
import java.sql.Timestamp;

public interface GroupsLocalHome extends EJBLocalHome  {
    GroupsLocal findByPrimaryKey(String primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    GroupsLocal create(String group_key, String group_name, Timestamp date_add, String status_id) throws CreateException;
}
....



package mypackage6;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;
import java.sql.Timestamp;

public interface UsersLocalHome extends EJBLocalHome  {
    UsersLocal findByPrimaryKey(String primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    UsersLocal create(String user_key, String username, String password, String status_id, Timestamp date_add, ContactsLocal contacts_contact_key) throws CreateException;
}
Avatar billede dn666 Nybegynder
10. juli 2003 - 13:33 #5
Jeg er gået over til at benytte XDoclet og nu kører det..
Avatar billede dn666 Nybegynder
10. juli 2003 - 13:35 #6
så kan man "næsten" undgå at skrive deplyment descriptorne
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester