Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Caching and @Id

Hi,

I'm have a native query whose results I stuff into an Entity.  The
query uses a LEFT JOIN and it's awfully hard figuring out uniqueness
per row since the LEFT JOIN can return null columns.

I've mapped the results to an @Entity which has one arbitrary column
defined as an @Id (only because I have to).  Since I have caching
turned off completely:

            <property name="eclipselink.cache.type.default" value="NONE"/>

I expect every entity mapped to be its own object.  However, if the
result set has three rows with the same value in the @Id field/column,
the same Java object ends up being there three times instead of three
different objects.  I realize why it's doing this (looking at the @Id
and saying "oh well, I already have this object so why map a new one")
but want to change this behavior.

I even tried messing with the cache size and shared cache properties
but no luck.

Any help would be appreciated.

Zarar


Back to the top