Package com.caucho.amber.table

Examples of com.caucho.amber.table.AmberTable


    CollectionTableConfig collectionTableConfig = _collectionTable;
    AmberPersistenceUnit persistenceUnit = _sourceType.getPersistenceUnit();

    String sqlTable = collectionTableConfig.getName();
    AmberTable mapTable = persistenceUnit.createTable(sqlTable);

    HashMap<String, JoinColumnConfig> joinColumnsConfig
      = collectionTableConfig.getJoinColumnMap();

    ArrayList<ForeignColumn> sourceColumns = null;
View Full Code Here


    EntityType type = getEntityType();

    if (type.getSecondaryTables().size() > 0) {
      for (AmberField field : type.getFields()) {
        AmberTable subTable = field.getTable();

        if (subTable != null && subTable != type.getTable()) {
          LinkColumns link = subTable.getDependentIdLink();

          FromItem item = parser.createDependentFromItem(_fromItem, link);

          _subItems.add(item);
        }
View Full Code Here

    cb.append(fk.getTargetColumn().getName());

    // changed to IN for jpa/10ca cb.append("EXISTS (SELECT *");
    cb.append(" IN (SELECT "); // SELECT *");
    cb.append(fk.getName());
    AmberTable table = join.getSourceTable();
    cb.append(" FROM " + table.getName() + " caucho");
    cb.append(" WHERE ");

    String targetTable = oneToMany.getParent().getChildFromItem().getName();

    cb.append(join.generateJoin("caucho", targetTable));
View Full Code Here

              // jpa/0l4b
              if (parentType != relatedType) {
                FromItem child = pathExpr.getChildFromItem();

                AmberTable table = relatedType.getTable(); // parentType.getTable();
                ArrayList<LinkColumns> outgoingLinks = table.getOutgoingLinks();

                for (LinkColumns link : outgoingLinks) {
                  if (link.getTargetTable().equals(parentType.getTable())) {
                    rootItem = addFromItem((EntityType) parentType,
                                           parentType.getTable());
View Full Code Here

      return this;

    if (_fromItem == null)
      _fromItem = _parent.bindSubPath(parser);

    AmberTable targetTable = _linkColumns.getTargetTable();
    _childFromItem = parser.addFromItem(targetTable, id);

    JoinExpr joinExpr;
    joinExpr = new ManyToOneJoinExpr(_linkColumns,
                                     _fromItem,
View Full Code Here

    if (_fromItem != null)
      return this;

    _fromItem = _parent.bindSubPath(parser);

    AmberTable sourceTable = _linkColumns.getSourceTable();
    _childFromItem = parser.addFromItem(sourceTable, id);

    JoinExpr joinExpr;
    joinExpr = new OneToManyJoinExpr(_linkColumns,
                                     _childFromItem,
View Full Code Here

    else
      throw new UnsupportedOperationException();

    LinkColumns join = oneToMany.getLinkColumns();

    AmberTable table = join.getSourceTable();
    cb.append("EXISTS(SELECT ");

    if (table.getIdColumns().size() > 0)
      cb.append(table.getIdColumns().get(0).getName());
    else
      cb.append('*');

    cb.append(" FROM " + table.getName() + " " + _tableName);
    cb.append(" WHERE ");

    String targetTable = oneToMany.getParent().getChildFromItem().getName();

    cb.append(join.generateJoin(_tableName, targetTable));
View Full Code Here

    if (_fromItem != null)
      return this;

    _fromItem = _parent.bindSubPath(parser);

    AmberTable sourceTable = _linkColumns.getSourceTable();
    _childFromItem = parser.addFromItem(sourceTable, id);

    JoinExpr joinExpr;
    joinExpr = new OneToManyJoinExpr(_linkColumns,
                                     _childFromItem,
View Full Code Here

    String sqlTable = _sourceType.getTable().getName() + "_" +
      targetType.getTable().getName();

    JoinTableConfig joinTableConfig = getJoinTable();

    AmberTable mapTable = null;

    ArrayList<ForeignColumn> sourceColumns = null;
    ArrayList<ForeignColumn> targetColumns = null;

    HashMap<String,JoinColumnConfig> joinColumnsConfig = null;
View Full Code Here

    int dirtyCount = _entityType.getDirtyIndex();
    for (int i = 0; i <= dirtyCount / 64; i++) {
      out.println("__caucho_dirtyMask_" + i + " = 0L;");
    }

    AmberTable table = _entityType.getTable();

    String sql = null;

    out.println("String sql;");
View Full Code Here

TOP

Related Classes of com.caucho.amber.table.AmberTable

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.