org.springframework.data.jpa.repository.support.JpaEntityInformationSupport Java Examples

The following examples show how to use org.springframework.data.jpa.repository.support.JpaEntityInformationSupport. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CodelessDaoProxy.java    From sca-best-practice with Apache License 2.0 4 votes vote down vote up
private <T> JpaEntityInformation<T, ?> getEntityInformation(Class<T> clazz) {
    JpaEntityInformation<T, ?> entityInformation = (JpaEntityInformation<T, ?>)entityInformationMap.get(clazz);
    if (entityInformation != null) {
        return entityInformation;
    }
    entityInformationMap.putIfAbsent(clazz, JpaEntityInformationSupport
        .getEntityInformation(clazz, entityManager));
    return (JpaEntityInformation<T, ?>)entityInformationMap.get(clazz);
}
 
Example #2
Source File: VirtualHostRepositoryImpl.java    From galeb with Apache License 2.0 4 votes vote down vote up
private boolean entityIsNew(VirtualHost virtualHost) {
    JpaEntityInformation<VirtualHost, ?> entityInformation = JpaEntityInformationSupport
            .getEntityInformation(VirtualHost.class, genericDaoService.entityManager());

    return entityInformation.isNew(virtualHost);
}
 
Example #3
Source File: EntityInformationFacade.java    From spring-content with Apache License 2.0 4 votes vote down vote up
public EntityInformation getEntityInformation(Class<?> entityClass, EntityManager em) {
    return JpaEntityInformationSupport.getEntityInformation(entityClass, em);
}
 
Example #4
Source File: GenericRepositoryImpl.java    From HA-DB with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public GenericRepositoryImpl(Class<E> domainClass, EntityManager em) {
	this(JpaEntityInformationSupport.getMetadata(domainClass, em), em);
}
 
Example #5
Source File: GenericJpaRepositoryImpl.java    From genericdao with Artistic License 2.0 4 votes vote down vote up
public GenericJpaRepositoryImpl(Class<T> domainClass, EntityManager entityManager) {
	//modified for spring data starter 1.3
	super(domainClass , entityManager);
	this.entityInformation = JpaEntityInformationSupport.getEntityInformation(domainClass, entityManager) ;
	this.entityManager = entityManager;
}
 
Example #6
Source File: SoftDeletesRepositoryImpl.java    From spring-boot-jpa-data-rest-soft-delete with MIT License 4 votes vote down vote up
public SoftDeletesRepositoryImpl(Class<T> domainClass, EntityManager em) {
	super(domainClass, em);
	this.em = em;
	this.domainClass = domainClass;
	this.entityInformation = JpaEntityInformationSupport.getEntityInformation(domainClass, em);
}
 
Example #7
Source File: RepositoryHelper.java    From es with Apache License 2.0 4 votes vote down vote up
public <T> JpaEntityInformation<T, ?> getMetadata(Class<T> entityClass) {
    return JpaEntityInformationSupport.getMetadata(entityClass, entityManager);
}
 
Example #8
Source File: GenericRepositoryImpl.java    From gazpachoquest with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates a new {@link SimpleJpaRepository} to manage objects of the given
 * domain type.
 */
protected GenericRepositoryImpl(final Class<T> domainClass, final EntityManager em) {
    this(JpaEntityInformationSupport.getMetadata(domainClass, em), em, null);
}