本文整理汇总了Java中com.turbomanage.storm.api.Entity类的典型用法代码示例。如果您正苦于以下问题:Java Entity类的具体用法?Java Entity怎么用?Java Entity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Entity类属于com.turbomanage.storm.api包,在下文中一共展示了Entity类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateModel
import com.turbomanage.storm.api.Entity; //导入依赖的package包/类
@Override
public void populateModel() {
// TODO make more elegant
Entity entity = this.typeElement.getAnnotation(Entity.class);
if (entity != null) {
this.entityModel = new EntityModel(entity);
} else {
javax.persistence.Entity jpaEntity = this.typeElement.getAnnotation(javax.persistence.Entity.class);
if (jpaEntity != null) {
this.entityModel = new EntityModel(jpaEntity);
}
}
super.populateModel();
this.entityModel.addImport(getQualifiedClassName());
validateTableName(entityModel.getTableName());
chooseDatabase(entityModel.getDbName());
chooseBaseDao(entity);
readFields(typeElement);
inspectId();
// TODO Verify >1 column. If only ID col, insert() will fail
}
示例2: getBaseDaoTypeMirror
import com.turbomanage.storm.api.Entity; //导入依赖的package包/类
/**
* Trying to get Class<?> from an annotation raises an exception
* see http://stackoverflow.com/questions/7687829/java-6-annotation-processing-getting-a-class-from-an-annotation
*/
private static TypeMirror getBaseDaoTypeMirror(Entity entity) {
if(entity != null) {
try {
entity.baseDaoClass();
} catch (MirroredTypeException mte) {
return mte.getTypeMirror();
}
}
return null;
}
示例3: getBaseDaoClass
import com.turbomanage.storm.api.Entity; //导入依赖的package包/类
/**
* Builds a BaseDaoModel from the class passed as attribute baseDaoClass of the annotation Entity
* @param entity
* @return BaseDaoModel containing the package name + Class name
*/
private static BaseDaoModel getBaseDaoClass(Entity entity) {
String qualifiedName = SQLiteDao.class.getName();
TypeMirror typeMirror = getBaseDaoTypeMirror(entity);
if(typeMirror != null) qualifiedName = typeMirror.toString();
return new BaseDaoModel(qualifiedName);
}
示例4: chooseBaseDao
import com.turbomanage.storm.api.Entity; //导入依赖的package包/类
protected void chooseBaseDao(Entity entity) {
BaseDaoModel baseDao = getBaseDaoClass(entity);
this.entityModel.setBaseDaoClass(baseDao);
}
示例5: EntityModel
import com.turbomanage.storm.api.Entity; //导入依赖的package包/类
public EntityModel(Entity entity) {
this.setTableName(entity.name());
this.setDbName(entity.dbName());
}