本文整理汇总了Java中act.db.DB类的典型用法代码示例。如果您正苦于以下问题:Java DB类的具体用法?Java DB怎么用?Java DB使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DB类属于act.db包,在下文中一共展示了DB类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MasterEntityMetaInfoRepo
import act.db.DB; //导入依赖的package包/类
public MasterEntityMetaInfoRepo(final App app) {
super(app);
final MasterEntityMetaInfoRepo me = this;
app.jobManager().on(SysEventId.CLASS_LOADED, new Runnable() {
@Override
public void run() {
final ClassInfoRepository classRepo = app.classLoader().classInfoRepository();
for (Map.Entry<String, EntityClassMetaInfo> entry : lookup.entrySet()) {
Class<?> entityClass = app.classForName(entry.getKey());
EntityClassMetaInfo info = entry.getValue();
info.mergeFromMappedSuperClasses(classRepo, me);
register(entityClass, info);
DB db = entityClass.getAnnotation(DB.class);
String dbId = (null == db ? DB.DEFAULT : db.value()).toUpperCase();
EntityMetaInfoRepo repo = regions.get(dbId);
if (null == repo) {
repo = new EntityMetaInfoRepo(app);
regions.put(dbId, repo);
}
repo.register(entityClass, info);
}
}
});
}
示例2: ebean
import act.db.DB; //导入依赖的package包/类
public EbeanServer ebean() {
if (null != ebean) {
return ebean;
}
synchronized (this) {
if (null == ebean) {
DB db = modelType().getAnnotation(DB.class);
String dbId = null == db ? DbServiceManager.DEFAULT : db.value();
EbeanService dbService = getService(dbId, app().dbServiceManager());
E.NPE(dbService);
setEbean(dbService.ebean());
}
}
return ebean;
}
示例3: ds
import act.db.DB; //导入依赖的package包/类
public DataSource ds() {
if (null != ds) {
return ds;
}
synchronized (this) {
if (null == ds) {
DB db = modelType().getAnnotation(DB.class);
String dbId = null == db ? DbServiceManager.DEFAULT : db.value();
EbeanService dbService = getService(dbId, app().dbServiceManager());
E.NPE(dbService);
ds = dbService.dataSource();
}
}
return ds;
}
示例4: equals
import act.db.DB; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof DB)) {
return false;
}
DB other = (DB) o;
return db.equals(other.value());
}
示例5: forDefaultDb
import act.db.DB; //导入依赖的package包/类
public EntityMetaInfoRepo forDefaultDb() {
return forDb(DB.DEFAULT);
}
示例6: forDb
import act.db.DB; //导入依赖的package包/类
public EntityMetaInfoRepo forDb(String dbId) {
return regions.get(null == dbId ? DB.DEFAULT : dbId.toUpperCase());
}
示例7: findSvcId
import act.db.DB; //导入依赖的package包/类
private $.T2<Class, String> findSvcId(List<Type> typeParameters) {
// the EbeanDao<Long, User> and MorphiaDao<User> case
Type modelType = (typeParameters.size() > 1) ? typeParameters.get(1) : typeParameters.get(0);
DB db = AnnotationUtil.declaredAnnotation((Class)modelType, DB.class);
return $.T2((Class) modelType, null == db ? DbServiceManager.DEFAULT : db.value());
}
示例8: annotationType
import act.db.DB; //导入依赖的package包/类
@Override
public Class<? extends Annotation> annotationType() {
return DB.class;
}
示例9: toString
import act.db.DB; //导入依赖的package包/类
@Override
public String toString() {
return "@" + DB.class.getName() + "(value=" + db + ")";
}