java-persistence-api Questions

16

Solved

EntityManager.merge() can insert new objects and update existing ones. Why would one want to use persist() (which can only create new objects)?
Manzoni asked 1/7, 2009 at 16:3

7

Solved

The JPA (Java Persistence API) specification has 2 different ways to specify entity composite keys: @IdClass and @EmbeddedId. I'm using both annotations on my mapped entities, but it turns out to...
Citify asked 17/10, 2008 at 14:21

3

I'm using the javax.persistence package to map my Java classes. I have entities like these: public class UserEntity extends IdEntity { } which extends a mapped superclass named IdEntity: @Map...
Hooknose asked 25/11, 2016 at 10:39

1

Solved

I have a book class with a list of authors: @Entity @Table(name = "book") public class Book extends Content { @ManyToMany(fetch = FetchType.LAZY) private List<Author> authors; ...} Now,...
Opheliaophelie asked 18/1, 2016 at 11:1
1

© 2022 - 2024 — McMap. All rights reserved.