DATAJPA-1104 - Further removals of Serializable requirements for identifiers.
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.jpa.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
@@ -34,8 +33,7 @@ import org.springframework.data.repository.query.QueryByExampleExecutor;
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@NoRepositoryBean
|
||||
public interface JpaRepository<T, ID extends Serializable>
|
||||
extends PagingAndSortingRepository<T, ID>, QueryByExampleExecutor<T> {
|
||||
public interface JpaRepository<T, ID> extends PagingAndSortingRepository<T, ID>, QueryByExampleExecutor<T> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -96,16 +94,17 @@ public interface JpaRepository<T, ID extends Serializable>
|
||||
*/
|
||||
T getOne(ID id);
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.query.QueryByExampleExecutor#findAll(org.springframework.data.domain.Example)
|
||||
*/
|
||||
@Override
|
||||
<S extends T> List<S> findAll(Example<S> example);
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.query.QueryByExampleExecutor#findAll(org.springframework.data.domain.Example, org.springframework.data.domain.Sort)
|
||||
*/
|
||||
@Override
|
||||
<S extends T> List<S> findAll(Example<S> example, Sort sort);
|
||||
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.jpa.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.metamodel.SingularAttribute;
|
||||
|
||||
import org.springframework.data.jpa.repository.query.JpaEntityMetadata;
|
||||
@@ -59,5 +57,5 @@ public interface JpaEntityInformation<T, ID> extends EntityInformation<T, ID>, J
|
||||
* @param idAttribute
|
||||
* @return
|
||||
*/
|
||||
Object getCompositeIdAttributeValue(Serializable id, String idAttribute);
|
||||
Object getCompositeIdAttributeValue(Object id, String idAttribute);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.jpa.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
@@ -208,9 +207,9 @@ public class JpaMetamodelEntityInformation<T, ID> extends JpaEntityInformationSu
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jpa.repository.support.JpaEntityInformation#getCompositeIdAttributeValue(java.io.Serializable, java.lang.String)
|
||||
* @see org.springframework.data.jpa.repository.support.JpaEntityInformation#getCompositeIdAttributeValue(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
public Object getCompositeIdAttributeValue(Serializable id, String idAttribute) {
|
||||
public Object getCompositeIdAttributeValue(Object id, String idAttribute) {
|
||||
|
||||
Assert.isTrue(hasCompositeId(), "Model must have a composite Id!");
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.jpa.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
|
||||
@@ -34,7 +32,7 @@ import org.springframework.util.Assert;
|
||||
* @author Eberhard Wolff
|
||||
* @param <T> the type of the repository
|
||||
*/
|
||||
public class JpaRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable>
|
||||
public class JpaRepositoryFactoryBean<T extends Repository<S, ID>, S, ID>
|
||||
extends TransactionalRepositoryFactoryBeanSupport<T, S, ID> {
|
||||
|
||||
private EntityManager entityManager;
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.springframework.data.jpa.repository.support;
|
||||
|
||||
import static org.springframework.data.jpa.repository.query.QueryUtils.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -73,8 +72,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*/
|
||||
@Repository
|
||||
@Transactional(readOnly = true)
|
||||
public class SimpleJpaRepository<T, ID extends Serializable>
|
||||
implements JpaRepository<T, ID>, JpaSpecificationExecutor<T> {
|
||||
public class SimpleJpaRepository<T, ID> implements JpaRepository<T, ID>, JpaSpecificationExecutor<T> {
|
||||
|
||||
private static final String ID_MUST_NOT_BE_NULL = "The given id must not be null!";
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ public class JpaEntityInformationSupportUnitTests {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getCompositeIdAttributeValue(Serializable id, String idAttribute) {
|
||||
public Object getCompositeIdAttributeValue(Object id, String idAttribute) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user