jpql « Load « JPA Q&A

1. jpql don't load Blob

    @NamedQuery(name = "Item.findAll", query = "select i from Item i"),
public class Item implements Serializable, WithId, WithNameDescription {
    byte[] photo;

2. Insert to JPA collection without loading it

I'm currently using code like this to add a new entry to a set in my entity.

player = em.find(Player.class, playerId);
player.getAvatarAttributeOwnership().add(new AvatarAttributeOwnership(...));
It works, but every time I want to add one item, ...

3. How to eagerly load lazy fields with JPA 2.0?

I have an entity class that has a lazy field like this:

public Movie implements Serializable {
    @Basic(fetch = FetchType.LAZY)
    private String ...

4. Force lazy relation to load using JPQL

Hello all, Can I force a lazy to load using JPQL? Suppose I have two classes, Parent and Kid. Parent have many kids, and, normally, I don't want to load them ...