本文整理汇总了Java中com.mysema.query.types.EntityPath类的典型用法代码示例。如果您正苦于以下问题:Java EntityPath类的具体用法?Java EntityPath怎么用?Java EntityPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityPath类属于com.mysema.query.types包,在下文中一共展示了EntityPath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: singlePath
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public JoinDescription singlePath(EntityPath<?> path) {
Assert.notNull(path);
singlePath = path;
collectionPath = null;
return this;
}
开发者ID:encircled,项目名称:Joiner,代码行数:8,代码来源:JoinDescription.java
示例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;
}
开发者ID:encircled,项目名称:Joiner,代码行数:17,代码来源:JoinDescription.java
示例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;
}
开发者ID:encircled,项目名称:Joiner,代码行数:11,代码来源:JoinerQueryBase.java
示例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);
}
}
开发者ID:encircled,项目名称:Joiner,代码行数:12,代码来源:ReflectionUtils.java
示例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);
}
}
开发者ID:encircled,项目名称:Joiner,代码行数:15,代码来源:DefaultAliasResolver.java
示例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);
}
}
}
开发者ID:encircled,项目名称:Joiner,代码行数:12,代码来源:Joiner.java
示例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);
}
开发者ID:encircled,项目名称:Joiner,代码行数:9,代码来源:EclipselinkRepository.java
示例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);
}
开发者ID:u2ware,项目名称:springfield,代码行数:29,代码来源:SpringfieldQueryTemplateTest.java
示例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);
}
开发者ID:yanaga,项目名称:winter-data-jpa,代码行数:8,代码来源:EntityPathResolverTest.java
示例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);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:AbstractDao.java
示例11: JPQLGridDataSource
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public JPQLGridDataSource(HibernateSessionManager sessionManager,
EntityPath<?> path, OrderSpecifier<?> order, boolean caseSensitive,
Predicate filters) {
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:AbstractDao.java
示例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;
}
开发者ID:edmocosta,项目名称:queryfy,代码行数:7,代码来源:QueryDslContext.java
示例13: from
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public static Builder from(EntityPath type) {
return new Builder(type);
}
开发者ID:edmocosta,项目名称:queryfy,代码行数:4,代码来源:QueryDslContext.java
示例14: getEntityPath
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public EntityPath getEntityPath() {
return entityPath;
}
开发者ID:edmocosta,项目名称:queryfy,代码行数:4,代码来源:QueryDslContext.java
示例15: Builder
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public Builder(EntityPath entityPath) {
this.entityPath = entityPath;
}
开发者ID:edmocosta,项目名称:queryfy,代码行数:4,代码来源:QueryDslContext.java
示例16: TupleJoinerQuery
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public TupleJoinerQuery(EntityPath<T> from, Expression<?>... returnProjections) {
super(from);
this.returnProjections = returnProjections;
}
开发者ID:encircled,项目名称:Joiner,代码行数:5,代码来源:TupleJoinerQuery.java
示例17: JoinDescription
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public JoinDescription(EntityPath<?> alias) {
Assert.notNull(alias);
originalAlias = alias;
alias(alias);
}
开发者ID:encircled,项目名称:Joiner,代码行数:7,代码来源:JoinDescription.java
示例18: getAlias
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public EntityPath<?> getAlias() {
return alias;
}
开发者ID:encircled,项目名称:Joiner,代码行数:4,代码来源:JoinDescription.java
示例19: getOriginalAlias
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public EntityPath<?> getOriginalAlias() {
return originalAlias;
}
开发者ID:encircled,项目名称:Joiner,代码行数:4,代码来源:JoinDescription.java
示例20: getSinglePath
import com.mysema.query.types.EntityPath; //导入依赖的package包/类
public EntityPath<?> getSinglePath() {
return singlePath;
}
开发者ID:encircled,项目名称:Joiner,代码行数:4,代码来源:JoinDescription.java
注:本文中的com.mysema.query.types.EntityPath类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论