I’m using Eclipselink and I’m trying figure out the best way to create a base class for my entity.
For example, I have a User entity and I would like to provide an extended User class for some clients, but I would like to not have to rewrite my generic queries.
So I would have a User entity and a ClientSpecificUser entity, but be able to pull up ClientSpecificUser by using the query “select e from User e”.
Has anyone done something like? What worked best?
Java 5 Generics could be a good fit for this issue, to institute a generic DAO layer. Here are 2 examples: