Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.DerivedDbAttribute


        }
    }

    static class DerivedDbAttributeFactory extends ObjAttributeFactory {
        protected Object create(String name, Object namingContext) {
            return new DerivedDbAttribute(
                name,
                TypesMapping.NOT_DEFINED,
                (DbEntity) namingContext,
                DerivedDbAttribute.ATTRIBUTE_TOKEN);
        }
View Full Code Here


    /**
     * @deprecated since 3.0M2 (scheduled for removal in 3.0M3)
     */
    static class DerivedDbAttributeFactory extends ObjAttributeFactory {
        protected Object create(String name, Object namingContext) {
            return new DerivedDbAttribute(
                name,
                TypesMapping.NOT_DEFINED,
                (DbEntity) namingContext,
                DerivedDbAttribute.ATTRIBUTE_TOKEN);
        }
View Full Code Here

        if (attribute.getType() == TypesMapping.NOT_DEFINED) {
            validator.registerWarning("DbAttribute has no type.", path);
        }

        if (attribute instanceof DerivedDbAttribute) {
            DerivedDbAttribute derived = (DerivedDbAttribute) attribute;
            int paramCount = derived.getParams().size();

            String spec = derived.getExpressionSpec();
            int paramsExpected = 0;
            if (spec != null) {
                // count tokens
                int ind = -DerivedDbAttribute.ATTRIBUTE_TOKEN.length();
                while ((ind = spec.indexOf(DerivedDbAttribute.ATTRIBUTE_TOKEN, ind
View Full Code Here

        if (attribute.getType() == TypesMapping.NOT_DEFINED) {
            validator.registerWarning("DbAttribute has no type.", path);
        }

        if (attribute instanceof DerivedDbAttribute) {
            DerivedDbAttribute derived = (DerivedDbAttribute) attribute;
            int paramCount = derived.getParams().size();

            String spec = derived.getExpressionSpec();
            int paramsExpected = 0;
            if (spec != null) {
                // count tokens
                int ind = -DerivedDbAttribute.ATTRIBUTE_TOKEN.length();
                while ((ind = spec.indexOf(DerivedDbAttribute.ATTRIBUTE_TOKEN, ind
View Full Code Here

      default: return "";
    }
  }

  public Object getValueAt(int row, int column) {
    DerivedDbAttribute attr = (DerivedDbAttribute)getAttribute(row);

    if (attr == null) {
      return "";
    }
View Full Code Here

        return "";
    }
  }
 
  public void setUpdatedValueAt(Object newVal, int row, int col) {
    DerivedDbAttribute attr = (DerivedDbAttribute)getAttribute(row);
    if (attr == null) {
      return;
    }

    AttributeEvent e = new AttributeEvent(eventSource, attr, entity);

    switch (col) {
      case DB_ATTRIBUTE_NAME :
        e.setOldName(attr.getName());
        setAttributeName((String) newVal, attr);
        fireTableCellUpdated(row, col);
        break;
      case DB_ATTRIBUTE_SPEC :
        setSpec((String) newVal, attr);
View Full Code Here

        }
    }

    static class DerivedDbAttributeFactory extends ObjAttributeFactory {
        protected Object create(String name, Object namingContext) {
            return new DerivedDbAttribute(
                name,
                TypesMapping.NOT_DEFINED,
                (DbEntity) namingContext,
                DerivedDbAttribute.ATTRIBUTE_TOKEN);
        }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.DerivedDbAttribute

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.