Note that there are some explanatory texts on larger screens.

plurals
  1. POJpa Objet has null value on the references
    primarykey
    data
    text
    <p>I have an object returned by a Hibernate Query, an object which should have a list of replacements in it. So, I have an "order" Object which should have a "Replacement" Set in it, the problem is that when I lookup that list, this is what i get <code>com.sun.jdi.InvocationException occurred invoking method.</code> and then, when the code keeps running and I try to acces that set, this is what I get <code>failed to lazily initialize a collection of role: uo.ri.model.Order.ReplacementList, no session or session was closed</code></p> <p>I Really have no idea why I'm having this error, I'm going to paste here my <code>Order</code> and my <code>Replacement</code> classes, hope you can solve it</p> <pre><code>@Entity @Table(name = "TOrder") public class Order implements Serializable { @Id @GeneratedValue long id; @Temporal(TemporalType.DATE) private Date creation_date; @Temporal(TemporalType.DATE) private Date reception_date; @Enumerated(EnumType.STRING) private PedidoStatus status; private float price; @OneToMany(mappedBy = "order") private Set&lt;PedidoRepuesto&gt; replacementList= new HashSet&lt;PedidoRepuesto&gt;(); @ManyToOne private Proveedor provider; } @Entity @Table(name = "TReplacement") public class Repuesto implements Serializable { @Id @GeneratedValue long id; private String name; private double price; private int having; private int likeToHave; private int minimumToHave; private int totalHaving; private float totalPrice; @OneToMany(mappedBy = "replacement") private Set&lt;OrderReplacement&gt; orderReplacements= new HashSet&lt;OrderReplacement&gt;(); @OneToMany(mappedBy = "replacement") private Set&lt;Sustitucion&gt; sustituciones = new HashSet&lt;Sustitucion&gt;(); @OneToMany(mappedBy = "replacement") private Set&lt;ProviderReplacement&gt; providerReplacement= new HashSet&lt;ProviderReplacement&gt;(); } </code></pre> <p>Both clases has the getters/setters and constructors.</p> <p>If you need me to paste here more clases or something please just ask. Thank you so much.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload