For the benefit of all DS Data users who prefer persist() and merge() over save(), I propose to extend the Data API by something like this:

public interface FullEntityRepository<E, PK extends Serializable>
    extends EntityRepository<E, PK>, EntityManagerDelegate<E> {
}


public abstract class AbstractFullEntityRepository<E, PK extends Serializable>
    extends AbstractEntityRepository<E, PK>
    implements EntityManagerDelegate<E> {

}

I don't really care about the exact class names (Full, Extended, you name it), the point is that end users can simply write

public interface CustomerRepository extends FullEntityRepository<Customer, Long> {}

to get access to all EntityManager methods.

What do you think?

Regards,
Harald

Reply via email to