Exemplo n.º 1
1
  protected void calculateModelAttributes() {
    String pakkage = calculateJavaModelPackage();

    StringBuilder sb = new StringBuilder();
    sb.append(pakkage);
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    sb.append("Key"); // $NON-NLS-1$
    setPrimaryKeyType(sb.toString());

    sb.setLength(0);
    sb.append(pakkage);
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    setBaseRecordType(sb.toString());

    sb.setLength(0);
    sb.append(pakkage);
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    sb.append("WithBLOBs"); // $NON-NLS-1$
    setRecordWithBLOBsType(sb.toString());

    sb.setLength(0);
    sb.append(pakkage);
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    sb.append("Example"); // $NON-NLS-1$
    setExampleType(sb.toString());
  }
Exemplo n.º 2
1
  protected void calculateJavaClientAttributes() {
    if (context.getJavaClientGeneratorConfiguration() == null) {
      return;
    }

    StringBuilder sb = new StringBuilder();
    sb.append(calculateJavaClientImplementationPackage());
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    sb.append("DAOImpl"); // $NON-NLS-1$
    setDAOImplementationType(sb.toString());

    sb.setLength(0);
    sb.append(calculateJavaClientInterfacePackage());
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    sb.append("DAO"); // $NON-NLS-1$
    setDAOInterfaceType(sb.toString());

    sb.setLength(0);
    sb.append(calculateJavaClientInterfacePackage());
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    sb.append("Mapper"); // $NON-NLS-1$
    setMyBatis3JavaMapperType(sb.toString());

    sb.setLength(0);
    sb.append(calculateJavaClientInterfacePackage());
    sb.append('.');
    sb.append(fullyQualifiedTable.getDomainObjectName());
    sb.append("SqlProvider"); // $NON-NLS-1$
    setMyBatis3SqlProviderType(sb.toString());
  }
Exemplo n.º 3
0
 protected String calculateMyBatis3FallbackSqlMapNamespace() {
   StringBuilder sb = new StringBuilder();
   sb.append(calculateSqlMapPackage());
   sb.append('.');
   sb.append(fullyQualifiedTable.getDomainObjectName());
   sb.append("Mapper"); // $NON-NLS-1$
   return sb.toString();
 }
Exemplo n.º 4
0
  protected String calculateJavaModelPackage() {
    JavaModelGeneratorConfiguration config = context.getJavaModelGeneratorConfiguration();

    StringBuilder sb = new StringBuilder();
    sb.append(config.getTargetPackage());
    sb.append(fullyQualifiedTable.getSubPackage(isSubPackagesEnabled(config)));

    return sb.toString();
  }
Exemplo n.º 5
0
  protected String calculateIbatis2SqlMapPackage() {
    SqlMapGeneratorConfiguration config = context.getSqlMapGeneratorConfiguration();

    StringBuilder sb = new StringBuilder(config.getTargetPackage());
    if (StringUtility.isTrue(config.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) {
      sb.append(fullyQualifiedTable.getSubPackage());
    }
    return sb.toString();
  }
Exemplo n.º 6
0
  protected String calculateSqlMapPackage() {
    StringBuilder sb = new StringBuilder();
    SqlMapGeneratorConfiguration config = context.getSqlMapGeneratorConfiguration();

    // config can be null if the Java client does not require XML
    if (config != null) {
      sb.append(config.getTargetPackage());
      sb.append(fullyQualifiedTable.getSubPackage(isSubPackagesEnabled(config)));
    }

    return sb.toString();
  }
Exemplo n.º 7
0
  protected String calculateJavaClientInterfacePackage() {
    JavaClientGeneratorConfiguration config = context.getJavaClientGeneratorConfiguration();
    if (config == null) {
      return null;
    }

    StringBuilder sb = new StringBuilder();
    sb.append(config.getTargetPackage());

    sb.append(fullyQualifiedTable.getSubPackage(isSubPackagesEnabled(config)));

    return sb.toString();
  }
Exemplo n.º 8
0
  protected String calculateJavaClientInterfacePackage() {
    JavaClientGeneratorConfiguration config = context.getJavaClientGeneratorConfiguration();
    if (config == null) {
      return null;
    }

    StringBuilder sb = new StringBuilder();
    sb.append(config.getTargetPackage());
    if (StringUtility.isTrue(config.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))) {
      sb.append(fullyQualifiedTable.getSubPackage());
    }

    return sb.toString();
  }
Exemplo n.º 9
0
 protected String calculateSqlMapAliasedFullyQualifiedRuntimeTableName() {
   return fullyQualifiedTable.getAliasedFullyQualifiedTableNameAtRuntime();
 }
Exemplo n.º 10
0
 protected String calculateIbatis2SqlMapNamespace() {
   return fullyQualifiedTable.getIbatis2SqlMapNamespace();
 }
Exemplo n.º 11
0
 protected String calculateMyBatis3XmlMapperFileName() {
   StringBuilder sb = new StringBuilder();
   sb.append(fullyQualifiedTable.getDomainObjectName());
   sb.append("Mapper.xml"); // $NON-NLS-1$
   return sb.toString();
 }
Exemplo n.º 12
0
 protected String calculateIbatis2SqlMapFileName() {
   StringBuilder sb = new StringBuilder();
   sb.append(fullyQualifiedTable.getIbatis2SqlMapNamespace());
   sb.append("_SqlMap.xml"); // $NON-NLS-1$
   return sb.toString();
 }
Exemplo n.º 13
0
  protected void calculateExtjsAttributes() {
    String appName = calculateExtjsAppName();
    String pakkage = calculateExtjsPackage();
    if (null == appName || appName.trim().isEmpty()) {
      return;
    }
    if (null == pakkage || pakkage.trim().isEmpty()) {
      return;
    }
    //
    String domainObjectName = fullyQualifiedTable.getDomainObjectName();

    // TODO 添加
    //
    StringBuilder sb = new StringBuilder();
    // model
    sb.setLength(0);
    sb.append(appName);
    sb.append(".");
    sb.append("model");
    sb.append(".");
    sb.append(pakkage);
    sb.append('.');
    sb.append(domainObjectName);
    setExtjsModel(sb.toString());

    // store
    sb.setLength(0);
    sb.append(appName);
    sb.append(".");
    sb.append("store");
    sb.append(".");
    sb.append(pakkage);
    sb.append('.');
    sb.append(domainObjectName);
    sb.append("Store"); // $NON-NLS-1$
    setExtjsStore(sb.toString());

    // grid
    sb.setLength(0);
    sb.append(appName);
    sb.append(".");
    sb.append("view");
    sb.append(".");
    sb.append(pakkage);
    sb.append('.');
    sb.append(domainObjectName);
    sb.append("Grid"); // $NON-NLS-1$
    setExtjsGrid(sb.toString());

    // controller
    sb.setLength(0);
    sb.append(appName);
    sb.append(".");
    sb.append("controller");
    sb.append(".");
    sb.append(pakkage);
    sb.append('.');
    sb.append(domainObjectName);
    sb.append("Controller"); // $NON-NLS-1$
    setExtjsController(sb.toString());
  }