• Post Reply Bookmark Topic Watch Topic
  • New Topic

Persisting one domain object should persist other domain objects as well automaticly  RSS feed

taltun taltun
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Currently when I have an object User with e.g. Message

public class User {
private Long id;
private Message message = new Message("My Message");

public class UserService {

public saveUser(User user) {

// Currently I have this solution. I don't like this solution.
Message message = messageDao.save(user.getMessage);

// I need this solution.
// The depended Message object is persisteted too automaticly without explicitly
// persist the message object before persisting the user obect separatly like above example.


Is this possible ?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!