Java 类org.springframework.data.jpa.repository.support.JpaEntityInformation 实例源码

项目:OperatieBRP    文件:CustomJpaRepositoryFactory.java   
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
protected SimpleJpaRepository<?, ?> getTargetRepository(
        final RepositoryMetadata metadata,
        final EntityManager entityManager) {
    final Class<?> repositoryInterface = metadata.getRepositoryInterface();
    final JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType());

    if (isQueryDslSpecificExecutor(repositoryInterface)) {
        throw new IllegalArgumentException("QueryDSL interface niet toegestaan");
    }

    return isMaxedRepository(repositoryInterface)
            ? new CustomSimpleMaxedJpaRepository(entityInformation, entityManager)
            : isQuerycostRepository(repositoryInterface)
                    ? new CustomSimpleQuerycostJpaRepository(entityInformation, entityManager, maxCostsQueryPlan)
                    : new CustomSimpleJpaRepository(entityInformation, entityManager);
}
项目:strategy-spring-security-acl    文件:AclJpaRepositoryFactoryBean.java   
protected SimpleJpaRepository<?, ?> getTargetRepository(RepositoryInformation information,
    EntityManager entityManager) {
  Class<?> domainType = information.getDomainType();
  if (!hasAclStrategyAnnotation(domainType)) {
    return super.getTargetRepository(information, entityManager);
  }

  JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(domainType);

  // invokes
  // com.github.lothar.security.acl.jpa.repository.AclJpaRepository.AclJpaRepository(JpaEntityInformation<T,
  // ?>, EntityManager, JpaSpecProvider<T>)
  SimpleJpaRepository<?, ?> repository = getTargetRepositoryViaReflection(information,
      entityInformation, entityManager, jpaSpecProvider);
  logger.debug("Created {}", repository);

  return repository;
}
项目:os    文件:DefaultRepositoryFactory.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected <T, ID extends Serializable> SimpleJpaRepository<?, ?> getTargetRepository(
        RepositoryInformation information, EntityManager entityManager) {
    JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(information.getDomainType());
    return new GenericRepositoryImpl(entityInformation, entityManager);
}
项目:spring-data-examples    文件:ApplicationConfigurationTest.java   
@Test
public void repositoriesAreAssignedToAppropriateStores() {

    Repositories repositories = new Repositories(context);

    assertThat(repositories.getEntityInformationFor(Customer.class), is(instanceOf(JpaEntityInformation.class)));
    assertThat(repositories.getEntityInformationFor(Order.class), is(instanceOf(MongoEntityInformation.class)));
}
项目:infobip-spring-data-jpa-querydsl    文件:SimpleExtendedQueryDslJpaRepository.java   
SimpleExtendedQueryDslJpaRepository(JpaEntityInformation<T, ID> entityInformation,
                                    EntityManager entityManager) throws SQLException {
    super(entityInformation, entityManager, SimpleEntityPathResolver.INSTANCE);
    this.jpaQueryFactory = new JPAQueryFactory(HQLTemplates.DEFAULT, entityManager);
    this.path = SimpleEntityPathResolver.INSTANCE.createPath(entityInformation.getJavaType());
    SQLTemplates sqlTemplates = getSQLServerTemplates(entityManager.getEntityManagerFactory());
    this.jpaSqlFactory = () -> new JPASQLQuery<>(entityManager, sqlTemplates);
    this.entityManager = entityManager;
}
项目:spring-repository-plus    文件:TestEntityRepositoryTest.java   
@Before
public void setup(){
    JpaEntityInformation<TestEntity, Integer> information = new JpaMetamodelEntityInformation<>(
            TestEntity.class, em.getMetamodel());
    repository = new SimpleJpaRepository<>(information, em);
    entities = SpecificationBuilder.selectDistinctFrom(repository).where(new Filter("string",EQUAL,"a")).findAll();
    Assert.assertTrue(entities.size() >= 1);
}
项目:OperatieBRP    文件:CustomSimpleMaxedJpaRepository.java   
/**
 * Creates a new {@link CustomSimpleMaxedJpaRepository} to manage objects of the given {@link JpaEntityInformation}.
 * @param entityInformation must not be {@literal null}.
 * @param entityManager must not be {@literal null}.
 * @param maximumRecords maximum aantal records
 */
public CustomSimpleMaxedJpaRepository(
        final JpaEntityInformation<T, ?> entityInformation,
        final EntityManager entityManager,
        final int maximumRecords) {
    super(entityInformation, entityManager);
    em = entityManager;
    this.maximumRecords = maximumRecords;
}
项目:OperatieBRP    文件:CustomSimpleQuerycostJpaRepository.java   
/**
 * Creates a new {@link CustomSimpleQuerycostJpaRepository} to manage objects of the given {@link JpaEntityInformation}.
 * @param entityInformation must not be {@literal null}.
 * @param entityManager must not be {@literal null}.
 * @param maxCostsQueryPlan maximum cost of a query plan
 */
CustomSimpleQuerycostJpaRepository(
        final JpaEntityInformation<T, ?> entityInformation,
        final EntityManager entityManager,
        final int maxCostsQueryPlan) {
    super(entityInformation, entityManager);
    this.em = entityManager;
    this.maxCostsQueryPlan = maxCostsQueryPlan;
}
项目:spring-data-jpa-extra    文件:RepoBasedConverter.java   
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
    Class<?>[] classes = GenericTypeResolver.resolveTypeArguments(this.getClass(), RepoBasedConverter.class);
    Class<?> clazz = classes[0];
    this.repositories = new Repositories(context);
    this.entityInformation = (JpaEntityInformation<S, ID>) repositories.getEntityInformationFor(clazz);
    this.genericJpaRepository = (GenericJpaRepository<S, ID>) repositories.getRepositoryFor(clazz);
    this.useCache = genericJpaRepository instanceof CachingJpaRepository;
}
项目:spring-data-jpa-extra    文件:GenericJpaRepositoryImpl.java   
public GenericJpaRepositoryImpl(JpaEntityInformation<T, ID> eif, EntityManager em) {
    super(eif, em);
    this.em = em;
    this.eif = eif;
    PropertyDescriptor descriptor = findFieldPropertyDescriptor(eif.getJavaType(), Status.class);
    isStatusAble = descriptor != null;
    if (isStatusAble) {
        statusReadMethod = descriptor.getReadMethod();
        statusWriteMethod = descriptor.getWriteMethod();
    }
}
项目:g2    文件:DefaultRepositoryFactory.java   
@Override
protected <T, ID extends Serializable> JpaRepository<?, ?> getTargetRepository(
        RepositoryMetadata metadata, EntityManager entityManager) {

    JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata
            .getDomainType());
    return new GenericRepositoryImpl(entityInformation, entityManager); // custom
                                                                        // implementation
}
项目:spring-data-jpa-entity-graph    文件:EntityGraphQuerydslRepository.java   
public EntityGraphQuerydslRepository(
    JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) {
  super(entityInformation, entityManager);
  this.querydslJpaRepositoryDelegate =
      new EntityGraphAwareQuerydslJpaRepository<>(
          (JpaEntityInformation<T, ID>) entityInformation, entityManager);
}
项目:spring-data-jpa-entity-graph    文件:EntityGraphQuerydslRepository.java   
public EntityGraphQuerydslRepository(
    JpaEntityInformation<T, ID> entityInformation,
    EntityManager entityManager,
    EntityPathResolver resolver) {
  super(entityInformation, entityManager);
  this.querydslJpaRepositoryDelegate =
      new EntityGraphAwareQuerydslJpaRepository<>(entityInformation, entityManager, resolver);
}
项目:lobbycal    文件:CalendarDTRepositoryFactoryBean.java   
@SuppressWarnings({ "unchecked" })
protected Object getTargetRepository(RepositoryMetadata metadata) {
    JpaEntityInformation<T, Serializable> entityInformation = (JpaEntityInformation<T, Serializable>) getEntityInformation(metadata
            .getDomainType());
    return new CalendarDTRepositoryImpl<T, ID>(entityInformation,
            entityManager);
}
项目:centromere    文件:CentromereJpaRepository.java   
public CentromereJpaRepository(JpaEntityInformation<T, ID> entityInformation,
        EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.metadata = entityInformation;
    this.entityManager = entityManager;
    this.queryBuilder = new JpaQueryBuilder<>(entityManager);
}
项目:springfield    文件:JpaRepository.java   
private JpaRepository(JpaEntityInformation<T, ID> info, EntityManager em) {
    //this.entityClass = info.getJavaType();
    this.entityInformation = info;
    this.entityManager = em;

    this.template = new SimpleJpaRepository<T, ID>(info, em);
    this.queryDslExecutor = new JpaQueryDslExecutor<T>(info.getJavaType(), em);
}
项目:spring-envers-audit    文件:RevisionAwareJpaRepositoryFactoryBean.java   
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected <T, ID extends Serializable> SimpleJpaRepository<?, ?> getTargetRepository(RepositoryMetadata metadata,
        EntityManager entityManager) {

    JpaEntityInformation<T, Serializable> entityInformation = (JpaEntityInformation<T, Serializable>) getEntityInformation(metadata
            .getDomainType());
    return new DefaultRevisionAwareJpaRepository(entityInformation, revisionEntityInformation, entityManager);
}
项目:spring-envers-audit    文件:DefaultRevisionAwareJpaRepository.java   
public DefaultRevisionAwareJpaRepository(JpaEntityInformation<T, ?> entityInformation, RevisionEntityInformation revisionEntityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);

    Assert.notNull(revisionEntityInformation);

    this.entityInformation = entityInformation;
    this.revisionEntityInformation = revisionEntityInformation;
    this.entityManager = entityManager;
}
项目:gazpachoquest    文件:GenericRepositoryImpl.java   
/**
 * Creates a new {@link SimpleJpaRepository} to manage objects of the given
 * {@link JpaEntityInformation}.
 */
public GenericRepositoryImpl(final JpaEntityInformation<T, ?> entityInformation, final EntityManager entityManager,
        final NamedQueryUtil namedQueryUtil) {
    super(entityInformation, entityManager);
    this.entityInformation = entityInformation;
    this.em = entityManager;
    // provider =
    // DefaultPersistenceProvider.fromEntityManager(entityManager);
    // this.springDataRepositoryInterface = springDataRepositoryInterface;
    this.namedQueryUtil = namedQueryUtil;
    this.byExampleSpecification = new ByExampleSpecification(entityManager);
}
项目:gazpachoquest    文件:DefaultRepositoryFactory.java   
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected <T, ID extends Serializable> SimpleJpaRepository<?, ?> getTargetRepository(
        final RepositoryMetadata metadata, final EntityManager entityManager) {

    Class<?> repositoryInterface = metadata.getRepositoryInterface();

    JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType());

    if (isQueryDslExecutor(repositoryInterface)) {
        return new QueryDslJpaRepository(entityInformation, entityManager);
    } else {
        return new GenericRepositoryImpl(entityInformation, entityManager, namedQueryUtil); // custom
    }
}
项目:os    文件:GenericRepositoryImpl.java   
public GenericRepositoryImpl(JpaEntityInformation<E, ?> entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.em = entityManager;
}
项目:sucok-framework    文件:BaseDao.java   
@Autowired
@SuppressWarnings("unchecked")
public void setEntityManager(EntityManager em) {
    this.em = em;
    this.entityInfo = (JpaEntityInformation<T, ID>) JpaEntityInformationSupport.getEntityInformation(entityClass,em);
}
项目:xm-ms-entity    文件:EntityGraphRepositoryImpl.java   
public EntityGraphRepositoryImpl(JpaEntityInformation<T, I> entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);

    this.entityManager = entityManager;
    this.domainClass = entityInformation.getJavaType();
}
项目:cloud    文件:WiselyRepositoryImpl.java   
public WiselyRepositoryImpl(JpaEntityInformation entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.entityManager = entityManager;
}
项目:OperatieBRP    文件:CustomSimpleJpaRepository.java   
/**
 * Creates a new {@link CustomSimpleJpaRepository} to manage objects of the given {@link JpaEntityInformation}.
 * @param entityInformation must not be {@literal null}.
 * @param entityManager must not be {@literal null}.
 */
public CustomSimpleJpaRepository(final JpaEntityInformation<T, ?> entityInformation, final EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.entityInformation = entityInformation;
    em = entityManager;
}
项目:xq_seckill_microservice    文件:BasicRepositoryImpl.java   
public BasicRepositoryImpl(JpaEntityInformation entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.entityManager = entityManager;
}
项目:sample-boot-micro    文件:OrmTemplate.java   
/** 指定したエンティティの ID 値を取得します。 */
@SuppressWarnings("unchecked")
public <T> Serializable idValue(T entity) {
    return ((JpaEntityInformation<T, Serializable>)OrmUtils.entityInformation(em, entity.getClass())).getId(entity);
}
项目:oma-riista-web    文件:BaseRepositoryImpl.java   
public BaseRepositoryImpl(final JpaEntityInformation<T, ID> entityInformation, final EntityManager entityManager) {
    super(entityInformation, entityManager);
    path = SimpleEntityPathResolver.INSTANCE.createPath(entityInformation.getJavaType());
    final PathBuilder<T> builder = new PathBuilder<>(path.getType(), path.getMetadata());
    this.querydsl = new Querydsl(entityManager, builder);
}
项目:ha-db    文件:GenericRepositoryImpl.java   
public GenericRepositoryImpl(JpaEntityInformation<E, ?> entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.em = entityManager;
}
项目:ha-db    文件:DefaultRepositoryFactory.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected <T, ID extends Serializable> SimpleJpaRepository<?, ?> getTargetRepository(RepositoryMetadata metadata, EntityManager entityManager) {
    JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType());
    return new GenericRepositoryImpl(entityInformation, entityManager);
}
项目:infotranspub-backend    文件:BaseRepositoryImpl.java   
public BaseRepositoryImpl(JpaEntityInformation<T, ID> entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
    // Keep the EntityManager around to used from the newly introduced methods.
    this.entityManager = entityManager;
    this.entityInformation = entityInformation;
}
项目:specification-with-projection    文件:JpaSpecificationExecutorWithProjectionImpl.java   
public JpaSpecificationExecutorWithProjectionImpl(JpaEntityInformation entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.entityManager = entityManager;
    this.entityInformation = entityInformation;
}
项目:java-platform    文件:BaseRepositoryImpl.java   
public BaseRepositoryImpl(JpaEntityInformation<T, I> entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
}
项目:java-platform    文件:TreeRepositoryImpl.java   
public TreeRepositoryImpl(JpaEntityInformation<T, I> entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
}
项目:strategy-spring-security-acl    文件:AclJpaRepository.java   
public AclJpaRepository(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager,
    JpaSpecProvider<T> jpaSpecProvider) {
  super(entityInformation, entityManager);
  this.jpaSpecProvider = jpaSpecProvider;
}
项目:genericdao    文件:GenericJpaRepositoryImpl.java   
public GenericJpaRepositoryImpl(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager){
    super(entityInformation, entityManager);
    this.entityInformation = entityInformation;
    this.entityManager = entityManager;
}
项目:genericdao    文件:GenericJpaRepositoryImpl.java   
public JpaEntityInformation<T, ?> getEntityInformation() {
    return entityInformation;
}
项目:spring-boot-jpa-data-rest-soft-delete    文件:SoftDeletesRepositoryImpl.java   
public ByIdSpecification(JpaEntityInformation<T, ?> entityInformation, ID id) {
    this.entityInformation = entityInformation;
    this.id = id;
}
项目:spring-boot-jpa-data-rest-soft-delete    文件:SoftDeletesRepositoryImpl.java   
public ByIdsSpecification(JpaEntityInformation<T, ?> entityInformation) {
    this.entityInformation = entityInformation;
}
项目:abixen-platform    文件:PlatformJpaRepositoryImpl.java   
public PlatformJpaRepositoryImpl(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) {
    super(entityInformation, entityManager);
    this.entityManager = entityManager;
}