本文整理了Java中io.ebean.Query.getBeanType
方法的一些代码示例,展示了Query.getBeanType
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getBeanType
方法的具体详情如下:
包路径:io.ebean.Query
类名称:Query
方法名:getBeanType
[英]Return the type of beans being queried.
[中]返回要查询的bean的类型。
代码示例来源:origin: ebean-orm/ebean
@Override
public <T> Set<String> validateQuery(Query<T> query) {
BeanDescriptor<T> beanDescriptor = getBeanDescriptor(query.getBeanType());
if (beanDescriptor == null) {
throw new PersistenceException("BeanDescriptor not found, is [" + query.getBeanType() + "] an entity bean?");
}
return ((SpiQuery<T>) query).validate(beanDescriptor);
}
代码示例来源:origin: ebean-orm/ebean
/**
* Restore draft beans to match live beans given the query.
*/
@Override
public <T> List<T> draftRestore(Query<T> query, Transaction transaction) {
Class<T> beanType = query.getBeanType();
BeanDescriptor<T> desc = server.getBeanDescriptor(beanType);
DraftHandler<T> draftHandler = new DraftHandler<>(desc, transaction);
List<T> liveBeans = draftHandler.fetchSourceBeans(query, false);
PUB.debug("draftRestore [{}] count[{}]", desc.getName(), liveBeans.size());
if (liveBeans.isEmpty()) {
return Collections.emptyList();
}
draftHandler.fetchDestinationBeans(liveBeans, true);
BeanManager<T> mgr = beanDescriptorManager.getBeanManager(beanType);
for (T liveBean : liveBeans) {
T draftBean = draftHandler.publishToDestinationBean(liveBean);
// reset @DraftDirty and @DraftReset properties
draftHandler.resetDraft(draftBean);
PUB.trace("draftRestore bean [{}] id[{}]", desc.getName(), draftHandler.getId());
update(createRequest(draftBean, transaction, null, mgr, Type.UPDATE, Flags.RECURSE));
}
PUB.debug("draftRestore - complete for [{}]", desc.getName());
return draftHandler.getDrafts();
}
代码示例来源:origin: ebean-orm/ebean
public <T> List<T> publish(Query<T> query, Transaction transaction) {
Class<T> beanType = query.getBeanType();
BeanDescriptor<T> desc = server.getBeanDescriptor(beanType);
代码示例来源:origin: icode/ameba
/**
* {@inheritDoc}
*/
@Override
public Class<T> getBeanType() {
return query.getBeanType();
}
代码示例来源:origin: org.actframework/act-ebean
@Override
public Class<MODEL_TYPE> getBeanType() {
return qReadOnly.getBeanType();
}
代码示例来源:origin: org.actframework/act-ebean2
@Override
public Class<MODEL_TYPE> getBeanType() {
return q.getBeanType();
}
代码示例来源:origin: io.ebean/ebean-querybean
/**
* Return the type of beans being queried.
*/
@Nonnull
public Class<T> getBeanType() {
return query.getBeanType();
}
代码示例来源:origin: io.ebean/ebean
@Override
public <T> Set<String> validateQuery(Query<T> query) {
BeanDescriptor<T> beanDescriptor = getBeanDescriptor(query.getBeanType());
if (beanDescriptor == null) {
throw new PersistenceException("BeanDescriptor not found, is [" + query.getBeanType() + "] an entity bean?");
}
return ((SpiQuery<T>) query).validate(beanDescriptor);
}
代码示例来源:origin: io.ebean/ebean
/**
* Restore draft beans to match live beans given the query.
*/
@Override
public <T> List<T> draftRestore(Query<T> query, Transaction transaction) {
Class<T> beanType = query.getBeanType();
BeanDescriptor<T> desc = server.getBeanDescriptor(beanType);
DraftHandler<T> draftHandler = new DraftHandler<>(desc, transaction);
List<T> liveBeans = draftHandler.fetchSourceBeans(query, false);
PUB.debug("draftRestore [{}] count[{}]", desc.getName(), liveBeans.size());
if (liveBeans.isEmpty()) {
return Collections.emptyList();
}
draftHandler.fetchDestinationBeans(liveBeans, true);
BeanManager<T> mgr = beanDescriptorManager.getBeanManager(beanType);
for (T liveBean : liveBeans) {
T draftBean = draftHandler.publishToDestinationBean(liveBean);
// reset @DraftDirty and @DraftReset properties
draftHandler.resetDraft(draftBean);
PUB.trace("draftRestore bean [{}] id[{}]", desc.getName(), draftHandler.getId());
update(createRequest(draftBean, transaction, null, mgr, Type.UPDATE, Flags.RECURSE));
}
PUB.debug("draftRestore - complete for [{}]", desc.getName());
return draftHandler.getDrafts();
}
代码示例来源:origin: io.ebean/ebean
public <T> List<T> publish(Query<T> query, Transaction transaction) {
Class<T> beanType = query.getBeanType();
BeanDescriptor<T> desc = server.getBeanDescriptor(beanType);
内容来源于网络,如有侵权,请联系作者删除!