openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <>
Subject Embeddable question
Date Fri, 13 Aug 2010 21:39:20 GMT
I ran across some unexpected behavior pertaining to Embeddables in OpenJPA
that I'm trying to understand. Lets says I have the following domain model:

class A{
  int id;
  Emb emb;

class Emb{

Now suppose the following scenario:

a = new A();

// At this point a.emb is null.

em  = emf.createEntityManagerFactory();
a = em.find(A.class,

// WHAT??? Now a.emb != null

// Note: If the previous em.find(...) would have loaded from the DataCache
a.emf is null.

So here is the question, how should this work? I understand that when we
read Entity A from the DB, we don't know if the embeddable should be a null
reference or it should be an Embeddable with no data. The spec doesn't
really detail how it should work, but I would like to have a consistent
behavior. Thoughts, opinions?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message