本文整理汇总了Java中javax.persistence.TupleElement类的典型用法代码示例。如果您正苦于以下问题:Java TupleElement类的具体用法?Java TupleElement怎么用?Java TupleElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TupleElement类属于javax.persistence包,在下文中一共展示了TupleElement类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createEntityFromTuple
import javax.persistence.TupleElement; //导入依赖的package包/类
private static <T> List<T> createEntityFromTuple(List<Tuple> tuples, Class<T> entity) {
List<T> entities = new ArrayList<>();
for (Tuple t : tuples) {
T el;
try {
el = entity.getConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException |
NoSuchMethodException | InvocationTargetException e) {
throw new AssertionError();
}
for (TupleElement<?> te : t.getElements()) {
Object o = t.get(te);
try {
Field f = getFieldFromEntity(entity, te.getAlias());
f.setAccessible(true);
f.set(el, o);
} catch (NoSuchFieldException | IllegalAccessException e1) {
throw new NoSuchEntityFieldException(e1.getMessage(), te.getAlias(), entity.getSimpleName());
}
}
entities.add(el);
}
return entities;
}
开发者ID:TFaga,项目名称:lynx,代码行数:36,代码来源:JPAUtils.java
示例2: get
import javax.persistence.TupleElement; //导入依赖的package包/类
@Override
public <X> X get(TupleElement<X> element) {
throw new UnsupportedOperationException();
}
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:5,代码来源:ObjectArrayTupleImpl.java
示例3: getElements
import javax.persistence.TupleElement; //导入依赖的package包/类
@Override
public List<TupleElement<?>> getElements() {
throw new UnsupportedOperationException();
}
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:5,代码来源:ObjectArrayTupleImpl.java
示例4: get
import javax.persistence.TupleElement; //导入依赖的package包/类
@Override
public <X> X get(TupleElement<X> tupleElement) {
throw new UnsupportedOperationException("not implemented");
}
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:5,代码来源:CriteriaTupleImpl.java
示例5: getElements
import javax.persistence.TupleElement; //导入依赖的package包/类
@Override
public List<TupleElement<?>> getElements() {
throw new UnsupportedOperationException("not implemented");
}
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:5,代码来源:CriteriaTupleImpl.java
示例6: testGetByTupleNotSupported
import javax.persistence.TupleElement; //导入依赖的package包/类
@Test(expected = UnsupportedOperationException.class)
public void testGetByTupleNotSupported() {
impl.get((TupleElement<?>) null);
}
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:5,代码来源:ObjectArrayTupleImplTest.java
示例7: getElements
import javax.persistence.TupleElement; //导入依赖的package包/类
public List<TupleElement<?>> getElements() {
return tuple.getElements();
}
开发者ID:ArneLimburg,项目名称:jpasecurity,代码行数:4,代码来源:SecureQuery.java
示例8: get
import javax.persistence.TupleElement; //导入依赖的package包/类
public <X> X get(TupleElement<X> tupleElement) {
return getSecureResult(tuple.get(tupleElement));
}
开发者ID:ArneLimburg,项目名称:jpasecurity,代码行数:4,代码来源:SecureQuery.java
示例9: elemTypeName
import javax.persistence.TupleElement; //导入依赖的package包/类
static final String elemTypeName(TupleElement<?> e) {
return e.getJavaType().getName();
}
开发者ID:solita,项目名称:query-utils,代码行数:4,代码来源:JpaCriteriaCopy.java
注:本文中的javax.persistence.TupleElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论