本文整理汇总了Java中com.mysema.query.types.EntityPath类的典型用法代码示例。如果您正苦于以下问题:Java EntityPath类的具体用法?Java EntityPath怎么用?Java EntityPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityPath类属于com.mysema.query.types包,在下文中一共展示了EntityPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: singlePath
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public JoinDescription singlePath(EntityPath<?> path) {
Assert.notNull(path);
singlePath = path;
collectionPath = null;
return this;
}
示例2: nested
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
/**
* Add children joins to current join from specified paths
*
* @param paths children join paths
* @return current join
*/
public JoinDescription nested(EntityPath<?>... paths) {
for (EntityPath<?> path : paths) {
JoinDescription join = J.left(path);
join.parent = this;
join.alias(J.path(this.getAlias(), join.getOriginalAlias()));
addJoin(join);
}
return this;
}
示例3: joins
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
@Override
public JoinerQueryBase<T, R> joins(EntityPath<?>... paths) {
for (EntityPath<?> path : paths) {
Assert.notNull(path);
addJoin(J.left(path));
}
return this;
}
示例4: instantiate
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static <T extends EntityPath> T instantiate(Class<? extends EntityPath> generatedClass, String alias) {
Assert.notNull(generatedClass);
try {
Constructor<? extends EntityPath> constructor = generatedClass.getConstructor(String.class);
return (T) constructor.newInstance(alias);
} catch (Exception e) {
throw new JoinerException("Failed to create new instance of " + generatedClass, e);
}
}
示例5: resolveJoinAlias
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void resolveJoinAlias(JoinDescription join, EntityPath<?> root) {
Path<?> parent = join.getParent() != null ? join.getParent().getAlias() : root;
Path<?> fieldOnParent = findPathOnParent(parent, join.getAlias().getType(), join);
if (fieldOnParent instanceof CollectionPathBase) {
join.collectionPath((CollectionPathBase<?, ?, ?>) fieldOnParent);
} else if (fieldOnParent instanceof EntityPath) {
join.singlePath((EntityPath<?>) fieldOnParent);
} else {
throw new JoinerException("Target field not found for join " + join);
}
}
示例6: addJoins
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
private void addJoins(List<JoinDescription> joins, JPAQuery query, EntityPath<?> rootPath, boolean doFetch) {
for (JoinDescription join : joins) {
joinerVendorRepository.addJoin(query, join);
if (doFetch && join.isFetch()) {
if (join.getJoinType().equals(JoinType.RIGHTJOIN)) {
throw new JoinerException("Fetch is not supported for right join!");
}
joinerVendorRepository.addFetch(query, join, joins, rootPath);
}
}
}
示例7: addFetch
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
@Override
public void addFetch(JPAQuery query, JoinDescription joinDescription, Collection<JoinDescription> joins, EntityPath<?> rootPath) {
String rootEntityAlias = rootPath.getMetadata().getName();
String path = resolvePathToFieldFromRoot(rootEntityAlias, joinDescription, joins);
String fetchHint = joinDescription.getJoinType().equals(com.mysema.query.JoinType.LEFTJOIN) ? "eclipselink.left-join-fetch" : "eclipselink.join-fetch";
query.setHint(fetchHint, path);
}
示例8: testQuery
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
@Test
@Transactional
public void testQuery() throws Exception {
springfieldQueryTemplateRepository.save(new SpringfieldQueryTemplate("a", 1));
springfieldQueryTemplateRepository.save(new SpringfieldQueryTemplate("b", 2));
springfieldQueryTemplateRepository.save(new SpringfieldQueryTemplate("c", 3));
List<SpringfieldQueryTemplate> result = springfieldQueryTemplateRepository.execute(
new TemplateCallback<List<SpringfieldQueryTemplate>, EntityManager>() {
public List<SpringfieldQueryTemplate> doInTemplate(EntityManager em) {
//Using QueryDsl
SpringfieldQueryTemplate alias = Alias.alias(SpringfieldQueryTemplate.class, "foo");
EntityPath<SpringfieldQueryTemplate> foo = Alias.$(alias);
StringPath fooName = Alias.$(alias.getName());
NumberPath<Integer> fooAge = Alias.$(alias.getAge());
JPAQuery query = new JPAQuery(em);
query.from(foo);
query.where(fooName.eq("a"));
query.where(fooAge.eq(1));
return query.list(foo);
}
});
Assert.assertEquals(result.size(), 1);
}
示例9: testResolveEntityPath
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
@Test
public void testResolveEntityPath() throws Exception {
EntityPathResolver entityPathResolver = new EntityPathResolver();
EntityPath<Person> entityPath = entityPathResolver.resolveEntityPath(Person.class);
assertNotNull(entityPath);
assertThat(entityPath.getType()).isEqualTo(Person.class);
}
示例10: createGridDataSource
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
protected <K> GridDataSource createGridDataSource(final EntityPath<K> path,
final OrderSpecifier<?> order, final boolean caseSensitive, final Predicate filters) {
return new JPQLGridDataSource<K>(getSessionManager(), path, order, caseSensitive, filters);
}
示例11: JPQLGridDataSource
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public JPQLGridDataSource(HibernateSessionManager sessionManager,
EntityPath<?> path, OrderSpecifier<?> order, boolean caseSensitive,
Predicate filters) {
}
示例12: QueryDslContext
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
protected QueryDslContext(EntityPath entityPath, Map<String, Expression> queryPaths, Map<String,
Expression> projectionPaths) {
this.entityPath = entityPath;
this.queryPaths = queryPaths;
this.projectionPaths = projectionPaths;
}
示例13: from
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public static Builder from(EntityPath type) {
return new Builder(type);
}
示例14: getEntityPath
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public EntityPath getEntityPath() {
return entityPath;
}
示例15: Builder
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public Builder(EntityPath entityPath) {
this.entityPath = entityPath;
}