Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This may be the answer; I'll have to wait several days to see if it indeed fixes the problem. There are actually two parts.</p> <p>First, for full disclosure, my <code>NewBar</code> class was actually a subclass of <code>AbstractBar</code>. I eventually wanted to have different type of embeddable bars, so I placed <code>@Embeddable</code> at the <code>AbstractBar</code> level, not at the <code>NewBar</code> level, and placed the private <code>foobar</code> field at the <code>AbstractBar</code> level as well. The funny thing is, this worked some of the time. And as I mentioned, sometimes I would come back the next day and Hibernate wouldn't load the <code>foobar</code> field. I don't understand why it didn't either work all the time or work none of the time.</p> <p>Secondly, when I tried to get rid of this hierarchy so as to eliminate one source of the problem, I conflated <code>AbstractBar</code> and <code>NewBar</code> but forgot to bring the <code>@Embeddable</code> up from <code>AbstractBar</code> to <code>NewBar</code>, so Hibernate didn't see that was an embeddable class, and didn't know how to load a string into a <code>NewBar</code> field without an <code>@Embeddable</code> designation. This is why <code>OtherBar</code> (with an <code>@Embeddable</code> annotation) worked, but not <code>NewBar</code> (with no <code>@Embeddable</code> annotation). This much I understand. Why Hibernate didn't warn me that it couldn't figure out how to load a field, I don't know.</p> <p>So to summarize, Hibernate won't load an embeddable field if you've left the <code>@Embeddable</code> annotation off the class. As for the original problem, I can only guess that <code>@Embeddable</code> is flaky when trying to use it on a class hierarchy, and that you're best off keeping all your embeddable fields at one level in the embeddable class. I hope that's the issue. We'll see if it continues to work tomorrow.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload