Java 类javax.persistence.TupleElement 实例源码
项目:lynx
文件:JPAUtils.java
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;
}
项目:crnk-framework
文件:ObjectArrayTupleImpl.java
@Override
public <X> X get(TupleElement<X> element) {
throw new UnsupportedOperationException();
}
项目:crnk-framework
文件:ObjectArrayTupleImpl.java
@Override
public List<TupleElement<?>> getElements() {
throw new UnsupportedOperationException();
}
项目:crnk-framework
文件:CriteriaTupleImpl.java
@Override
public <X> X get(TupleElement<X> tupleElement) {
throw new UnsupportedOperationException("not implemented");
}
项目:crnk-framework
文件:CriteriaTupleImpl.java
@Override
public List<TupleElement<?>> getElements() {
throw new UnsupportedOperationException("not implemented");
}
项目:crnk-framework
文件:ObjectArrayTupleImplTest.java
@Test(expected = UnsupportedOperationException.class)
public void testGetByTupleNotSupported() {
impl.get((TupleElement<?>) null);
}
项目:katharsis-framework
文件:ObjectArrayTupleImpl.java
@Override
public <X> X get(TupleElement<X> element) {
throw new UnsupportedOperationException();
}
项目:katharsis-framework
文件:ObjectArrayTupleImpl.java
@Override
public List<TupleElement<?>> getElements() {
throw new UnsupportedOperationException();
}
项目:katharsis-framework
文件:CriteriaTupleImpl.java
@Override
public <X> X get(TupleElement<X> tupleElement) {
throw new UnsupportedOperationException("not implemented");
}
项目:katharsis-framework
文件:CriteriaTupleImpl.java
@Override
public List<TupleElement<?>> getElements() {
throw new UnsupportedOperationException("not implemented");
}
项目:katharsis-framework
文件:ObjectArrayTupleImplTest.java
@Test(expected = UnsupportedOperationException.class)
public void testGetByTupleNotSupported() {
impl.get((TupleElement<?>) null);
}
项目:jpasecurity
文件:SecureQuery.java
public List<TupleElement<?>> getElements() {
return tuple.getElements();
}
项目:jpasecurity
文件:SecureQuery.java
public <X> X get(TupleElement<X> tupleElement) {
return getSecureResult(tuple.get(tupleElement));
}
项目:query-utils
文件:JpaCriteriaCopy.java
static final String elemTypeName(TupleElement<?> e) {
return e.getJavaType().getName();
}