Package jodd.db.oom.sqlgen

Examples of jodd.db.oom.sqlgen.DbSqlBuilderException


   * Lookups for entity name and throws exception if entity name not found.
   */
  protected DbEntityDescriptor lookupName(String entityName) {
    DbEntityDescriptor ded = templateData.getDbOomManager().lookupName(entityName);
    if (ded == null) {
      throw new DbSqlBuilderException("Entity name not registered: " + entityName);
    }
    return ded;
  }
View Full Code Here


   * Lookups for entity name and throws an exception if entity type is invalid.
   */
  protected DbEntityDescriptor lookupType(Class entity) {
    DbEntityDescriptor ded = templateData.getDbOomManager().lookupType(entity);
    if (ded == null) {
      throw new DbSqlBuilderException("Invalid or not-persistent entity: " + entity.getName());
    }
    return ded;
  }
View Full Code Here

   */
  protected DbEntityDescriptor lookupTableRef(String tableRef, boolean throwExceptionIfNotFound) {
    DbEntityDescriptor ded = templateData.getTableDescriptor(tableRef);
    if (ded == null) {
      if (throwExceptionIfNotFound) {
        throw new DbSqlBuilderException("Invalid table reference: " + tableRef);
      }
    }
    return ded;
  }
View Full Code Here

   * Finds for table that contains column,
   */
  protected DbEntityDescriptor findColumnRef(String columnRef) {
    DbEntityDescriptor ded = templateData.findTableDescriptorByColumnRef(columnRef);
    if (ded == null) {
      throw new DbSqlBuilderException("Invalid column reference: " + columnRef);
    }
    return ded;
  }
View Full Code Here

    } else {
      includeColumns = COLS_ONLY_EXISTING;
    }
    int eq = expression.indexOf('=');
    if (eq == -1) {
      throw new DbSqlBuilderException("Template syntax error, expected 'match' equality: {tableRef=objectRef}.");
    }
    tableRef = expression.substring(0, eq).trim();
    objectRef = expression.substring(eq + 1, lastNdx).trim();
  }
View Full Code Here

      DbEntityColumnDescriptor dec = ded.findByPropertyName(columnRef);
      templateData.lastColumnDec = dec;
      String columnName = dec == null ? null : dec.getColumnName();
      //String columnName = ded.getColumnName(columnRef);
      if (columnName == null) {
        throw new DbSqlBuilderException("Invalid column reference: " + tableRef + '.' + columnRef);
      }
      if (useTableReference) {
        appendColumnName(out, ded, columnName);
      } else {
        appendAlias(out, ded, columnName);
View Full Code Here

      templateData.lastColumnDec = dec;

      String column = dec == null ? null : dec.getColumnName();
      //String column = ded.getColumnName(columnRef);
      if (column == null) {
        throw new DbSqlBuilderException("Invalid column reference: " + tableRef + '.' + columnRef);
      }

      if (tableRef != null) {
        out.append('.');
      }
View Full Code Here

    } else {
      includeColumns = COLS_ONLY_EXISTING;
    }
    int eq = expression.indexOf('=');
    if (eq == -1) {
      throw new DbSqlBuilderException("Syntax error, expected 'match' equality: {tableRef=objectRef}.");
    }
    tableRef = expression.substring(0, eq).trim();
    objectRef = expression.substring(eq + 1, lastNdx).trim();
  }
View Full Code Here

TOP

Related Classes of jodd.db.oom.sqlgen.DbSqlBuilderException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.