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 ?