Ognjen Blagojevic wrote:
>
> It must be a way to INSERT objects in the database without looking up
> for all the references, but I am not able to find it.
>
My problem is similar as yours, with a single difference.
I don't mind loading all the references because I need them in the program.
Bu
I'm getting so frustrated with OpenJPA!
I'm also experiencing the problem listed in previous reply, and once again,
no response to that post.
Here's some code to explain my problem:
TblPdtbnf.java:
@OneToOne(fetch = FetchType.LAZY)
@JoinColumns([EMAIL PROTECTED](name
="PDTBNF_ID",referencedColumnN
Hi Anonimus,
What exception do you get when you don't specify CascadeType.PERSIST?
I'm assuming you're doing something like this :
Employee e = new Employe();
e.setName("John Doe");
Department d = em.find(Department.class, idDept); // this is what I think
you mean by loading all the references
Hi. I have problem with inserting in database.
I don't know how to insert object and disable an attempt of inserting in
related tables.
example:
@Entity
@Table(name = "MAIN_TABLE", schema = "SCH")
@Inheritance(strategy=InheritanceType.JOINED)
public class MainClass extends MainDataObject {
Hi Enrico,
Here is my example, and it runs fine:
(1) EntityA.java:
@Entity
public class EntityA {
@Column(name="A_ID")
@Id private int id;
private String name;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumns([EMAIL PROTECTED](name="B_ID",
referen
Hi Michael,
your assumptions are correct.
After em.persist(e); I get this exception if I specify CascadeType.PERSIST:
>org.apache.openjpa.persistence.InvalidStateException: The generated value
> processing detected an existing value assigned to this field:
> mypackage.Department.idDepartment.