-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: get update instead of insert into
PostPosted: Wed Jun 23, 2010 5:07 am 
Newbie

Joined: Fri May 21, 2010 8:37 am
Posts: 14
When using the below domain classes and have added new AX (ie not assigned an id, as there is no setter) I get update in the log instead of Insert into

Code:
...
@Entity
@Table(name="A")
public class A
{
   
    @Id
    @GeneratedValue(generator="SEQ_FELLES")
    @SequenceGenerator(name="SEQ_FELLES", sequenceName="ODB_FELLES_SEQ", allocationSize=1)
    @Column(name="A_ID")
    private long id;

    @OneToMany(mappedBy="A", fetch=FetchType.EAGER)
    private Set<AX> setOfAX;
...
}


Code:
@Entity
@Table(name="AX")
public class AX
{
    @Id
    @GeneratedValue(generator="SEQ_FELLES")
    @SequenceGenerator(name="SEQ_FELLES", sequenceName="ODB_FELLES_SEQ", allocationSize=1)
    @Column(name="AX_ID")
    private long id;
   
    @ManyToOne
    @JoinColumn(name="A_ID")
    private A aAObj;
   
    @ManyToOne
    @JoinColumn(name="C_ID")
    private C aCObj;

    @Column(name="SOME_VALUE")
    private long someValue;
...
}


Code:
@Entity
@Table(name="C")
public class C
{   
    @Id
    @Column(name="C_ID")
    private long cId;

    @Column(name="ANOTHER_VALUE")
    private long anotherValue;
...
}


Any clue as to why ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.