Problema entity bean 3.0
Publicado por Jano (1 intervención) el 27/02/2008 22:33:11
Hola a todos, estoy tratando de hacer una aplicacion con ejb 3 y tengo el siguiente problema:
tengo un cliente ejb con el siguiente codigo
final Context context = getInitialContext();
SessionEJB sessionEJB = (SessionEJB)context.lookup("SessionEJB");
for (Factura p:sessionEJB.queryFacturaFindAll( )){
System.out.println("id "+p.getId());
System.out.println("collection "+p.getDetallefacturaList());
}
en el id, me imprime el valor que corresponde; pero en collection me da el mensaje {IndirectList: not instantiated}
tengo las tablas en mysql
FACTURA
id number PK
DETALLEFACTURA
id_detalle number PK
id_factura number FK
articulo varchar
etc
las estidades con sus get y set:
@Entity
public class Factura implements Serializable {
@Id
@Column(nullable = false)
private Integer id;
@OneToMany(mappedBy = "factura")
private List<Detallefactura> detallefacturaList;
@Entity
public class Detallefactura implements Serializable {
private String articulo;
@Id
@Column(nullable = false)
private Integer id_detalle;
@ManyToOne
@JoinColumn(name = "id_factura", referencedColumnName = "id")
private Factura factura;
CUAL PUEDE SER EL PROBLEMA.
Gracias.
tengo un cliente ejb con el siguiente codigo
final Context context = getInitialContext();
SessionEJB sessionEJB = (SessionEJB)context.lookup("SessionEJB");
for (Factura p:sessionEJB.queryFacturaFindAll( )){
System.out.println("id "+p.getId());
System.out.println("collection "+p.getDetallefacturaList());
}
en el id, me imprime el valor que corresponde; pero en collection me da el mensaje {IndirectList: not instantiated}
tengo las tablas en mysql
FACTURA
id number PK
DETALLEFACTURA
id_detalle number PK
id_factura number FK
articulo varchar
etc
las estidades con sus get y set:
@Entity
public class Factura implements Serializable {
@Id
@Column(nullable = false)
private Integer id;
@OneToMany(mappedBy = "factura")
private List<Detallefactura> detallefacturaList;
@Entity
public class Detallefactura implements Serializable {
private String articulo;
@Id
@Column(nullable = false)
private Integer id_detalle;
@ManyToOne
@JoinColumn(name = "id_factura", referencedColumnName = "id")
private Factura factura;
CUAL PUEDE SER EL PROBLEMA.
Gracias.
Valora esta pregunta


0