From: jorge_tello5 <nu...@jb...> - 2005-08-02 21:27:55
|
Hi, My problem is: I got an Entity RolProcTrans (pk is codProceso, codTrans,tipoRol).=20 @Entity | @Table(name =3D "ROL_PROC_TRANS") | public class RolProcTrans implements Serializable { | =09private RolProcTransPK pk; | =09private RolTransaccion1 rolTransaccion1; |=20 | =09@ManyToOne | =09@JoinColumns( { | =09@JoinColumn(name =3D "COD_TRANS", insertable =3D false, updatable = =3D false), | =09@JoinColumn(name =3D "TIPO_ROL", insertable =3D false, updatable =3D= false) }) | =09public RolTransaccion1 getRolTransaccion1() { | =09=09return rolTransaccion1; | =09} |=20 | =09public void setRolTransaccion1(RolTransaccion1 rolTransaccion1) { | =09=09this.rolTransaccion1 =3D rolTransaccion1; | =09} |=20 | =09@Id(generate=3DGeneratorType.NONE) | =09 public RolProcTransPK getPk() { | =09 return pk; | =09 } | =09 | =09 public void setPk(RolProcTransPK pk) { | =09 this.pk =3D pk; | =09 } | } the pk class is: @Embeddable | public class RolProcTransPK implements Serializable { | =09private Long codProceso; | =09private String codTrans; | =09private Integer tipoRol; | ... and Entity RolTransaccion1 @Entity | @Table(name =3D "ROL_TRANSACCION_1") | public class RolTransaccion1 implements Serializable { | =09private String codEmpresa; | =09private RolTransaccion1PK pk; | =09private List<RolProcTrans> rolesProcTrans; |=20 | =09@OneToMany(fetch =3D FetchType.LAZY, mappedBy =3D "rolTransaccion1") | =09public List<RolProcTrans> getRolesProcTrans() { | =09=09return rolesProcTrans; | =09} |=20 | =09public void setRolesProcTrans(List<RolProcTrans> rolesProcTrans) { | =09=09this.rolesProcTrans =3D rolesProcTrans; | =09} |=20 | =09@Column(name =3D "COD_EMPRESA") | =09public String getCodEmpresa() { | =09=09return codEmpresa; | =09} |=20 | =09public void setCodEmpresa(String codEmpresa) { | =09=09this.codEmpresa =3D codEmpresa; | =09} |=20 | =09@Id(generate=3DGeneratorType.NONE) | =09public RolTransaccion1PK getPk() { | =09=09return pk; | =09} |=20 | =09public void setPk(RolTransaccion1PK pk) { | =09=09this.pk =3D pk; | =09} | } pk class=20 @Embeddable | public class RolTransaccion1PK implements Serializable { | =09private String codTrans; | =09private Integer tipoRol; | ... I=C2=B4m use SQL Server 2000 SP3. When I try list RolProcTrans Entity the error is: 16:13:38,623 ERROR [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Drive= r for JDBC]Value can not be converted to requested type. I try, remove @ManyToOne relation and this function correctly What Happend? pleace some Idea. Thank you very much View the original post : http://www.jboss.org/index.html?module=3Dbb&op=3Dv= iewtopic&p=3D3888036#3888036 Reply to the post : http://www.jboss.org/index.html?module=3Dbb&op=3Dpostin= g&mode=3Dreply&p=3D3888036 |