On Thu, Oct 4, 2012 at 11:45 AM, Chris Geer <[email protected]> wrote:

> I'm having an issue with JPA and I'm hoping someone can help me out. As
> part of the object model restructure we are splitting some of the object
> dependencies and replacing them with IDs. For example, we are breaking the
> link between WidgetTag and Tag and having WidgetTag have a TagID. This
> means that when a new WidgetTag is created the system needs to create the
> new Tag object if it doesn't exist, get it's ID and then save the WidgetTag
> with the TagID. My problem is that when I create a new Tag and call
> TagRepository.save(tag), it "saves" but when it returns the Tag object it
> doesn't container an ID, but it's now a JPATag object. Is there a way to
> resolve that or do we need to do a save, then a get to return a fully
> populated object?


Additional information: It looks like when the entity comes back from the
entityManager.persist method it's detached. I've tried to figure out how to
correct that but I can't quite seem to figure it out. Any thoughts?

>
> Chris
>

Reply via email to