Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Cacheing non-root entities

I would like to cache, with @Cacheable, non-root entities.
 
Say you have this model:
@Entity
@Table(name = "parent")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING)
@SequenceGenerator(name = "SEQ_STORE", sequenceName = "entity_id_seq", allocationSize = 1)
abstract class AbstractEntityObject {
 
@Entity
@Table(name = "child")
@PrimaryKeyJoinColumn(name = "entity_id")
@DiscriminatorValue("PERSON")@Cacheable // This does not work in Hibernate because we're not the Root-entity 
class Person extends AbstractEntityObject
I want to cache inherited entities of AbstractEntityObject but am unable to do so in Hibernate because Hibernate only allows the root-entity, AbstractEntityObject, to be cached.
 
Is this according to spec or a Hibernate-limitation? Is this possible in EclipseLink? The point is that I don't want to cache *all* inherited entities of AbstractEntityObject.
 
Thanks.
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc

Back to the top