Hello guy!

We used postgreSqk, JBOSS 3.07, XDOCLET, ECLIPSE + LOMBOZ.

Next we introduce this diagram for explicating our problem
(A continuacion presentamos el siguiente diagrama para explicar nuestro
problema)

+----------+       +------------------------------------+
|ESTUDIANTE|1     *|INSCRIPCION                         |
+----------+-------+------------------------------------|
|ecodigo PK|       |icodigo PK                          |
|enombre   |       |ecodigo PK,FK(references ESTUDIANTE)|
+----------+       |ccodigo PK,FK(references CURSO)     |
                   +------------------------------------+
                               *|
                                |
                                |
                                |
                                |
                               1|
                         +----------+
                         |CURSO     |
                         +----------|
                         |ccodigo PK|
                         |cnombre   |
                         +----------+

ESTUDIANTE = STUDENT.
INSCRIPCION = INSCRIPTION.
CURSO = COURSE.
codigo = code.

How can you defining in a ENTITY BEAN CMP (INSCRIPCION) in a PK (primary
key) composed by three atribute, and two of these are FK (foreing key)?)
(�Como definir en un ENTITY BEAN CMP (INSCRIPCION) una PK (primary key)
compuesta por 3 atributos, de los cuales 2 son FK (foreing key)?)

We have developed the following code, but at the moment for making
deploy in Jboss, this throw one exception:
(Nostros hemos desarrollado el siguiente c�digo, pero en el momento de
realizar el montaje en jboss, este lanza la siguiente Exception)

"attribute "icodigoestudiante" duplicated

The code of the InscriptionEJB is:


package leufu;

import javax.ejb.EntityBean;

/**
* @ejb.bean name="Inscripcion"
*       local-jndi-name="InscripcionBean"
*       type="CMP"
*  cmp-version="2.x"
*  view-type="local"
*  schema="Inscripcion"
* 
*  @ejb.persistence 
*   table-name="inscripcion" 
* 
* @ejb.finder 
*    query="SELECT OBJECT(a) FROM Inscripcion as a"  
*    signature="java.util.Collection findAll()"  
*
* @jboss.create-table true
*   
**/

public abstract class InscripcionBean implements EntityBean {

/**
 * 
 * @ejb.create-method 
 */
public InscripcionPK ejbCreate(String codigo, EstudianteLocal e, CursoLocal c) throws 
javax.ejb.CreateException {
        setIMatricula(codigo);
        return new InscripcionPK(codigo,e,c);
}

/**
 * The container invokes this method immediately after it calls ejbCreate.
 * 
 */
public void ejbPostCreate(String codigo, EstudianteLocal e, CursoLocal c) throws 
javax.ejb.CreateException {
        setICodigoEstudiante(e);
        setICodigoCurso(c);
}

/**
*  
* @ejb.persistent-field 
* @ejb.pk-field
* @ejb.persistence
* @jboss.column-name imatricula
* @ejb.interface-method
*/
public abstract java.lang.String getIMatricula();

/**
* @ejb.interface-method
*/
public abstract void setIMatricula(java.lang.String IMatricula);

/**
*
*
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED] nce
[EMAIL PROTECTED] icodigoestudiante
[EMAIL PROTECTED]
*   
        
/* para las relaciones
* 
[EMAIL PROTECTED] name="estudiante-inscripcion" 
*role-name="inscripcion-estudiante" 
*target-ejb="Estudiante" 
*target-role-name=" " 
*target-multiple="yes"
*
[EMAIL PROTECTED]  related-pk-field="eCodigo" 
*fk-column="icodigoestudiante" 
*fk-constraint="true"
**/
        
public abstract leufu.EstudianteLocal getICodigoEstudiante();

/**
* 
* @ejb.interface-method
*/
public abstract void setICodigoEstudiante(leufu.EstudianteLocal ICodigoEstudiante);

/**
* 
* @ejb.persistent-field
* @ejb.pk-field
* @ejb.persistence
* @jboss.colum-name icodigocurso
* @ejb.interface-method 
        
* para las relaciones
* @ejb.relation name="curso-inscripcion" 
* role-name="inscripcion-curso" 
* target-ejb="Curso" 
* target-role-name=" " 
* target-multiple="yes"
*
[EMAIL PROTECTED]  related-pk-field="cCodigo"
*fk-column="icodigocurso" 
*fk-constraint="true"
*       
* 
*
*/
public abstract leufu.CursoLocal getICodigoCurso();

/**
* 
* @ejb.interface-method
*/
public abstract void setICodigoCurso(leufu.CursoLocal ICodigoCurso);

}

Thanks...


Cristian Rossel Moraga
CEO Leufu Ingenieria y Negocios Ltda.
56-41-511655.





-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to