camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Wolf <>
Subject Re: How to do conditional entity persistence in JPA Producer
Date Mon, 21 Jan 2013 18:35:09 GMT
(corrected Subject:)

On Mon, Jan 21, 2013 at 12:11 PM, Chris Wolf <> wrote:
> I recently changed a schema to be more normalized by factoring out a
> column of type varchar2 that takes one of only a few dozen, but long
> values,
> so I created a lookup table for these strings and replaced the
> sting-valued column in the main entity with a foreign-key valued
> column, referencing
> the lookup table.
> So now when I persist the main entity, I need to perform a lookup in
> the string lookup table and only create a new lookup entity if there's
> no entry, otherwise
> set the main entity's lookup ref to the PK of the found, matched
> string.  How can I do this in the jpa producer without introducing
> EntityManager/Query code
> in the entity or some pre-processing bean?
> Thanks,
> Chris

View raw message