当前位置: 首页>>代码示例>>Java>>正文


Java Entity类代码示例

本文整理汇总了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
}
 
开发者ID:turbomanage,项目名称:storm-gen,代码行数:22,代码来源:EntityProcessor.java

示例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;
}
 
开发者ID:turbomanage,项目名称:storm-gen,代码行数:15,代码来源:EntityProcessor.java

示例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);
}
 
开发者ID:turbomanage,项目名称:storm-gen,代码行数:12,代码来源:EntityProcessor.java

示例4: chooseBaseDao

import com.turbomanage.storm.api.Entity; //导入依赖的package包/类
protected void chooseBaseDao(Entity entity) {
    BaseDaoModel baseDao = getBaseDaoClass(entity);
    this.entityModel.setBaseDaoClass(baseDao);
}
 
开发者ID:turbomanage,项目名称:storm-gen,代码行数:5,代码来源:EntityProcessor.java

示例5: EntityModel

import com.turbomanage.storm.api.Entity; //导入依赖的package包/类
public EntityModel(Entity entity) {
	this.setTableName(entity.name());
	this.setDbName(entity.dbName());
}
 
开发者ID:turbomanage,项目名称:storm-gen,代码行数:5,代码来源:EntityModel.java


注:本文中的com.turbomanage.storm.api.Entity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。