I'm closely 
following http://www.jooq.org/doc/3.5/manual-single-page/#pojos, but cannot 
get #fetchInto to work.  I've tried every @Column JPA annotations (with and 
without the individual column selects) and the constructor (with and 
without @ConstructorProperties).  Am I missing anything obvious?

Thanks for any help available!

Here's the setup:

public List<Notification> getNotifications(User user) {
        List<Notification> notifications = 
jooq.select(Notifications.NOTIFICATIONS.TITLE, 
Notifications.NOTIFICATIONS.BODY)
                .from(Notifications.NOTIFICATIONS)
                
.where(Notifications.NOTIFICATIONS.USER_ID.equal(user.getId()))
                .fetchInto(Notification.class);
        return notifications;
}


@Entity
@Table(name = "notifications")
...
public class Notification {
@Id
@GeneratedValue
private int id;

@Column("title")
private String title;

@Lob
@Column("body")
private String body;

@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "user_id")
private User user;

    public Notification() {
    }

    @ConstructorProperties({"title", "body"})
    public Notification(String title, String body) {
        // jooq
        this.title = title;
        this.body = body;
    }

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getBody() {
return body;
}

public void setBody(String body) {
this.body = body;
}

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}
}

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to