Jarrod Marshall

+ Follow
since Aug 01, 2008
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jarrod Marshall

True, but if you need to serialize an object chain like this you get a stack overflow because JPA does not support unidirection OneToMany without a join table.
I appreciate the reply - not what I was hoping for.
I thought I had read that through the ORM.xml file it was possible to base a one to many on a foreign key.

The problem with the XmlTransient is that this uses proprietary, custom serialization routines. Not the out of the box java serialization.

I can avoid serializing the back ref back to the parent but when the object comes back into the java realm from the network and it attempts to deserialize it doesn't go out and get the back ref object and load it. The reason it needs contain just a foreign key is that this object will be automatically persisted via Coherence.
Hi all,
I'm fairly new to JPA and having to work through an issue.

I've used Netbeans and JDeveloper both to generate entities from tables.

Now, these entities cross language boundaries via serialization methods exposed with Oracle's Coherence - meaning, entities are both serialized to and from C# .NET objects.

Due to this serialization, I can't have the backref/many to one child->parent relationship on the child otherwise I get a stack overflow.

I just want a unidirectional relationship mapped from table a to table b with no middle join table. Sure, the many to one exists but I don't want it (can't have it) mapped.

On the child entity, I just want the ID of the parent, not an object that references the parent. Just a field with parent ID.

Any help would be greatly appreciated.