com.avaje.ebean.Query.getBeanType()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中com.avaje.ebean.Query.getBeanType方法的一些代码示例,展示了Query.getBeanType的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getBeanType方法的具体详情如下:
包路径:com.avaje.ebean.Query
类名称:Query
方法名:getBeanType

Query.getBeanType介绍

[英]Return the type of beans being queried.
[中]返回要查询的bean的类型。

代码示例

代码示例来源:origin: org.actframework/act-ebean-java7

@Override
public Class<MODEL_TYPE> getBeanType() {
  return qReadOnly.getBeanType();
}

代码示例来源:origin: org.avaje.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: org.avaje.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, true, false));
 }
 PUB.debug("draftRestore - complete for [{}]", desc.getName());
 return draftHandler.getDrafts();
}

代码示例来源:origin: org.avaje.ebean/ebean

public <T> List<T> publish(Query<T> query, Transaction transaction) {
 Class<T> beanType = query.getBeanType();
 BeanDescriptor<T> desc = server.getBeanDescriptor(beanType);

相关文章