deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Obermaier <>
Subject Deltaspike Data - Abstract Repositories
Date Sat, 16 Aug 2014 23:19:27 GMT
I've successfully migrated a self-made repository framework 
implementation to Deltaspike Data and so far it's a breeze!

The only thing I'm wondering is how to build custom abstract 
repositories with convenience methods all concrete repositories should 

The scenario is the following:

* All entities extend an AbstractEntity (with fields like 'uuid', 
'lastUpdated' and the 'id')
* I want to introduce an abstract repository (AbstractRepository) 
implementation with methods like "findByUuid", "getLastUpdated", ...
* All concrete repositories are abstract classes and should inherit from 

My naive (and non-working) approach was to write the following 4 classes:

public class AbstractEntity implements Serializable { ... }

public class User extends AbstractEntity { ... }

public abstract class AbstractRepository<T extends AbstractEntity> 
extends AbstractEntityRepository<T, Long> {

public abstract class UserRepository extends AbstractRepository<User> {

When I try to deploy that; I'm getting the following exception: 
Repository creation for class class 
com.acme.repository.AbstractRepository failed. Is it associated with a 
valid Entity?
---- SNIP ----

Is there something obvious I'm doing wrong? I'm glad for any help!

All the best,

View raw message