Package com.caucho.amber.type

Examples of com.caucho.amber.type.EntityType


    if (targetClass == null || void.class.equals(targetClass))
      throw error(field, L.l("Can't determine targetEntity for {0}.  @ManyToMany properties must target @Entity beans.",
                             _fieldName));

    EntityType targetType = persistenceUnit.getEntityType(targetClass);

    if (targetType == null)
      throw error(field,
            L.l("targetEntity '{0}' is not an @Entity bean for {1}.  The targetEntity of a @ManyToMany collection must be an @Entity bean.",
          targetClass.getName(),
View Full Code Here


        EntityItem value = valueRef.get();

        if (value == null)
          continue;

        EntityType entityRoot = value.getEntityHome().getEntityType();
        Object entityKey = key.getKey();

        for (int i = 0; i < size; i++) {
          if (completions.get(i).complete(entityRoot, entityKey, value)) {
            // XXX: delete
View Full Code Here

  static ArrayList<ForeignColumn> calculateColumns(com.caucho.amber.table.AmberTable mapTable,
                                                   EntityType type)
  {
    ArrayList<ForeignColumn> columns = new ArrayList<ForeignColumn>();

    EntityType parentType = type;

    ArrayList<com.caucho.amber.table.AmberColumn> targetIdColumns;

    targetIdColumns = type.getId().getColumns();

    while (targetIdColumns.size() == 0) {

      parentType = parentType.getParentType();

      if (parentType == null)
        break;

      targetIdColumns = parentType.getId().getColumns();
    }

    for (com.caucho.amber.table.AmberColumn key : targetIdColumns) {
      columns.add(mapTable.createForeignColumn(key.getName(), key));
    }
View Full Code Here

                                                   String prefix,
                                                   EntityType type)
  {
    ArrayList<ForeignColumn> columns = new ArrayList<ForeignColumn>();

    EntityType parentType = type;

    ArrayList<com.caucho.amber.table.AmberColumn> targetIdColumns;

    targetIdColumns = type.getId().getColumns();

    while (targetIdColumns.size() == 0) {

      parentType = parentType.getParentType();

      if (parentType == null)
        break;

      targetIdColumns = parentType.getId().getColumns();
    }

    for (com.caucho.amber.table.AmberColumn key : targetIdColumns) {
      columns.add(mapTable.createForeignColumn(prefix + key.getName(), key));
    }
View Full Code Here

    _fromItem = _expr.bindSubPath(parser);

    if (_fromItem == null)
      throw new NullPointerException(_expr.getClass().getName() + " " + _expr);

    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

                             Map<AmberExpr, String> joinFetchMap)
    throws SQLException
  {
    // jpa/0h13, jpa/1160

    EntityType entityType = getEntityType();

    EntityItem item = entityType.getHome().findItem(aConn, rs, index);

    if (item == null)
      return null;

    int offset = entityType.getId().getKeyCount();

    Entity entity = item.getEntity();

    /* XXX: jpa/0s2c
    if (entityType.getDiscriminator() != null) {
View Full Code Here

    String name = _column.getName();

    AmberColumn column = null;

    if (_sourceType instanceof EntityType) {
      EntityType entityType = (EntityType) _sourceType;
     
      String tableName = _column.getTable();
      AmberTable table;

      if (tableName.equals("")) {
        table = entityType.getTable();

        if (table == null)
          throw error(_field, L.l("{0} @Column(name='{1}') is an unknown table.",
                                  _fieldName,
                                  name));
      }
      else {
        table = entityType.getSecondaryTable(tableName);

        if (table == null)
          throw error(_field, L.l("{0} @Column(table='{1}') is an unknown secondary table.",
                                  _fieldName,
                                  tableName));
View Full Code Here

    if (joinColumnMap == null)
      return;

    com.caucho.amber.field.Id id = targetType.getId();

    EntityType parentType = targetType;

    int idCols;

    // XXX: jpa/0l48
    while ((idCols = id.getKeyCount()) == 0) {
      parentType = parentType.getParentType();

      if (parentType == null)
        break;

      id = parentType.getId();
    }

    int size;
    Object joinColumnCfg[] = null;
View Full Code Here

                                                   String prefix,
                                                   EntityType type)
  {
    ArrayList<ForeignColumn> columns = new ArrayList<ForeignColumn>();

    EntityType parentType = type;

    ArrayList<com.caucho.amber.table.AmberColumn> targetIdColumns;

    targetIdColumns = type.getId().getColumns();

    while (targetIdColumns.size() == 0) {
      parentType = parentType.getParentType();

      if (parentType == null)
        break;

      targetIdColumns = parentType.getId().getColumns();
    }

    for (AmberColumn key : targetIdColumns) {
      columns.add(mapTable.createForeignColumn(prefix + key.getName(), key));
    }
View Full Code Here

  ArrayList<ForeignColumn> calculateColumns(AmberTable mapTable,
              EntityType type)
  {
    ArrayList<ForeignColumn> columns = new ArrayList<ForeignColumn>();

    EntityType parentType = type;

    ArrayList<AmberColumn> targetIdColumns;

    targetIdColumns = type.getId().getColumns();

    while (targetIdColumns.size() == 0) {
      parentType = parentType.getParentType();

      if (parentType == null)
        break;

      targetIdColumns = parentType.getId().getColumns();
    }

    for (AmberColumn key : targetIdColumns) {
      columns.add(mapTable.createForeignColumn(key.getName(), key));
    }
View Full Code Here

TOP

Related Classes of com.caucho.amber.type.EntityType

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.