de.greenrobot.daogenerator.Entity.getClassName()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(162)

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

Entity.getClassName介绍

暂无

代码示例

代码示例来源:origin: de.greenrobot/greendao-generator

@Override
public String toString() {
  String sourceName = sourceEntity != null ? sourceEntity.getClassName() : null;
  String targetName = targetEntity != null ? targetEntity.getClassName() : null;
  return "ToMany '" + name + "' from " + sourceName + " to " + targetName;
}

代码示例来源:origin: de.greenrobot/greendao-generator

private void checkAdditionalImportsEntityTargetEntity(Entity targetEntity) {
  if (!targetEntity.getJavaPackage().equals(javaPackage)) {
    additionalImportsEntity.add(targetEntity.getJavaPackage() + "." + targetEntity.getClassName());
  }
  if (!targetEntity.getJavaPackageDao().equals(javaPackage)) {
    additionalImportsEntity.add(targetEntity.getJavaPackageDao() + "." + targetEntity.getClassNameDao());
  }
}

代码示例来源:origin: devinhu/androidone

generate(templateDao, outDirFile, entity.getJavaPackageDao(), entity.getClassNameDao(), schema, entity);
if (!entity.isProtobuf() && !entity.isSkipGeneration()) {
  generate(templateEntity, outDirFile, entity.getJavaPackage(), entity.getClassName(), schema, entity);
  Map<String, Object> additionalObjectsForTemplate = new HashMap<String, Object>();
  additionalObjectsForTemplate.put("contentProvider", contentProvider);
  generate(templateContentProvider, outDirFile, entity.getJavaPackage(), entity.getClassName()
      + "ContentProvider", schema, entity, additionalObjectsForTemplate);

代码示例来源:origin: yangblocker/GreenDao-SQLCipher

@Override
public String toString() {
  String sourceName = sourceEntity != null ? sourceEntity.getClassName() : null;
  String targetName = targetEntity != null ? targetEntity.getClassName() : null;
  return "ToOne '" + name + "' from " + sourceName + " to " + targetName;
}

代码示例来源:origin: de.greenrobot/greendao-generator

generate(templateDao, outDirFile, entity.getJavaPackageDao(), entity.getClassNameDao(), schema, entity);
if (!entity.isProtobuf() && !entity.isSkipGeneration()) {
  generate(templateEntity, outDirEntityFile, entity.getJavaPackage(), entity.getClassName(), schema, entity);
  Map<String, Object> additionalObjectsForTemplate = new HashMap<String, Object>();
  additionalObjectsForTemplate.put("contentProvider", contentProvider);
  generate(templateContentProvider, outDirFile, entity.getJavaPackage(), entity.getClassName()
      + "ContentProvider", schema, entity, additionalObjectsForTemplate);

代码示例来源:origin: yangblocker/GreenDao-SQLCipher

private void checkAdditionalImportsEntityTargetEntity(Entity targetEntity) {
  if (!targetEntity.getJavaPackage().equals(javaPackage)) {
    additionalImportsEntity.add(targetEntity.getJavaPackage() + "." + targetEntity.getClassName());
  }
  if (!targetEntity.getJavaPackageDao().equals(javaPackage)) {
    additionalImportsEntity.add(targetEntity.getJavaPackageDao() + "." + targetEntity.getClassNameDao());
  }
}

代码示例来源:origin: yangblocker/GreenDao-SQLCipher

@Override
public String toString() {
  String sourceName = sourceEntity != null ? sourceEntity.getClassName() : null;
  String targetName = targetEntity != null ? targetEntity.getClassName() : null;
  return "ToMany '" + name + "' from " + sourceName + " to " + targetName;
}

代码示例来源:origin: de.greenrobot/greendao-generator

@Override
public String toString() {
  String sourceName = sourceEntity != null ? sourceEntity.getClassName() : null;
  String targetName = targetEntity != null ? targetEntity.getClassName() : null;
  return "ToOne '" + name + "' from " + sourceName + " to " + targetName;
}

代码示例来源:origin: de.greenrobot/greendao-generator

@Override
public String toString() {
  return "Property " + propertyName + " of " + entity.getClassName();
}

代码示例来源:origin: yangblocker/GreenDao-SQLCipher

@Override
public String toString() {
  return "Property " + propertyName + " of " + entity.getClassName();
}

代码示例来源:origin: de.greenrobot/greendao-generator

void init2ndPass() {
  if (name == null) {
    char[] nameCharArray = targetEntity.getClassName().toCharArray();
    nameCharArray[0] = Character.toLowerCase(nameCharArray[0]);
    name = new String(nameCharArray);
  }
}

代码示例来源:origin: de.greenrobot/greendao-generator

void init2ndPass() {
  if (name == null) {
    char[] nameCharArray = targetEntity.getClassName().toCharArray();
    nameCharArray[0] = Character.toLowerCase(nameCharArray[0]);
    name = new String(nameCharArray) + "List";
  }
}

代码示例来源:origin: yangblocker/GreenDao-SQLCipher

void init2ndPass() {
  if (name == null) {
    char[] nameCharArray = targetEntity.getClassName().toCharArray();
    nameCharArray[0] = Character.toLowerCase(nameCharArray[0]);
    name = new String(nameCharArray);
  }
}

代码示例来源:origin: de.greenrobot/greendao-generator

public void init2ndPass() {
  if (authority == null) {
    authority = schema.getDefaultJavaPackage() + ".provider";
  }
  if (basePath == null) {
    basePath = "";
  }
  if (className == null) {
    className = entities.get(0).getClassName() + "ContentProvider";
  }
  if (javaPackage == null) {
    javaPackage = schema.getDefaultJavaPackage();
  }
}

代码示例来源:origin: yangblocker/GreenDao-SQLCipher

void init2ndPass() {
  if (name == null) {
    char[] nameCharArray = targetEntity.getClassName().toCharArray();
    nameCharArray[0] = Character.toLowerCase(nameCharArray[0]);
    name = new String(nameCharArray) + "List";

代码示例来源:origin: yangblocker/GreenDao-SQLCipher

private void init3rdPassAdditionalImports() {
  if (active && !javaPackage.equals(javaPackageDao)) {
    additionalImportsEntity.add(javaPackageDao + "." + classNameDao);
  }
  for (ToOne toOne : toOneRelations) {
    Entity targetEntity = toOne.getTargetEntity();
    checkAdditionalImportsEntityTargetEntity(targetEntity);
    // For deep loading
    if (!targetEntity.getJavaPackage().equals(javaPackageDao)) {
      additionalImportsDao.add(targetEntity.getJavaPackage() + "." + targetEntity.getClassName());
    }
  }
  for (ToMany toMany : toManyRelations) {
    Entity targetEntity = toMany.getTargetEntity();
    checkAdditionalImportsEntityTargetEntity(targetEntity);
  }
}

代码示例来源:origin: de.greenrobot/greendao-generator

additionalImportsDao.add(targetEntity.getJavaPackage() + "." + targetEntity.getClassName());

代码示例来源:origin: devinhu/androidone

@Test
public void testMinimalSchema() throws Exception {
  Schema schema = new Schema(1, "de.greenrobot.testdao");
  Entity adressTable = schema.addEntity("Adresse");
  Property idProperty = adressTable.addIdProperty().getProperty();
  adressTable.addIntProperty("count").index();
  adressTable.addIntProperty("dummy").notNull();
  assertEquals(1, schema.getEntities().size());
  assertEquals(3, adressTable.getProperties().size());
  File daoFile = new File("test-out/de/greenrobot/testdao/" + adressTable.getClassName() + "Dao.java");
  daoFile.delete();
  assertFalse(daoFile.exists());
  new DaoGenerator().generateAll(schema, "test-out");
  assertEquals("PRIMARY KEY", idProperty.getConstraints());
  assertTrue(daoFile.toString(), daoFile.exists());
}

相关文章