Package com.caucho.amber.field

Examples of com.caucho.amber.field.ElementCollectionField


    addCollection(targetType);
  }

  private void addCollection(AmberType targetType)
  {
    ElementCollectionField eltCollectionField;

    eltCollectionField
      = new ElementCollectionField(_sourceType, _fieldName);
    eltCollectionField.setType(targetType);
    eltCollectionField.setLazy(isFetchLazy());

    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;
   
    sourceColumns
      = calculateColumns(_field, _fieldName, mapTable,
                         _sourceType.getTable().getName() + "_",
                         _sourceType,
                         joinColumnsConfig);

    eltCollectionField.setAssociationTable(mapTable);
    eltCollectionField.setTable(sqlTable);

    eltCollectionField.setSourceLink(new LinkColumns(mapTable,
                                                     _sourceType.getTable(),
                                                     sourceColumns));
   
    _sourceType.addField(eltCollectionField);
  }
View Full Code Here


   */
  public void generateSelect(CharBuffer cb)
  {
    String id = _childFromItem.getName();

    ElementCollectionField field
      = (ElementCollectionField) _targetType.getField();
   
    cb.append(field.generateLoadSelect(id));
  }
View Full Code Here

    addCollection(targetType);
  }

  private void addCollection(AmberType targetType)
  {
    ElementCollectionField eltCollectionField;

    eltCollectionField
      = new ElementCollectionField(_sourceType, _fieldName);
    eltCollectionField.setType(targetType);
    eltCollectionField.setLazy(isFetchLazy());

    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;
   
    sourceColumns
      = calculateColumns(_field, _fieldName, mapTable,
       _sourceType.getTable().getName() + "_",
       _sourceType,
       joinColumnsConfig);

    eltCollectionField.setAssociationTable(mapTable);
    eltCollectionField.setTable(sqlTable);

    eltCollectionField.setSourceLink(new LinkColumns(mapTable,
                 _sourceType.getTable(),
                 sourceColumns));
   
    _sourceType.addField(eltCollectionField);
  }
View Full Code Here

   */
  public void generateSelect(CharBuffer cb)
  {
    String id = _childFromItem.getName();

    ElementCollectionField field
      = (ElementCollectionField) _targetType.getField();
   
    cb.append(field.generateLoadSelect(id));
  }
View Full Code Here

TOP

Related Classes of com.caucho.amber.field.ElementCollectionField

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.