Package com.impossibl.postgres.types.CompositeType

Examples of com.impossibl.postgres.types.CompositeType.Attribute


    Object val = getNextAttributeValue();
    if (val == null) {
      return null;
    }

    Attribute attr = type.getAttribute(currentAttrIdx);
    if (attr == null) {
      throw new SQLException("Invalid input request (type not array)");
    }

    InputStream data = coerceToByteStream(getNextAttributeValue(), attr.type, connection);
View Full Code Here


    Object val = getNextAttributeValue();
    if (val == null) {
      return null;
    }

    Attribute attr = type.getAttribute(currentAttrIdx);
    if (attr == null) {
      throw new SQLException("Invalid input request (type not array)");
    }

    Class<?> targetType = mapGetType(attr.type, typeMap, connection);
View Full Code Here

    Object val = getNextAttributeValue();
    if (val == null) {
      return null;
    }

    Attribute attr = type.getAttribute(currentAttrIdx);
    if (attr == null || !(attr.type instanceof ArrayType) || !(val instanceof Object[])) {
      throw new SQLException("Invalid input request (type not array)");
    }

    return new PGArray(connection, (ArrayType)attr.type, (Object[])val);
View Full Code Here

    return attributeValues;
  }

  void writeNextAttributeValue(Object val) throws SQLException {

    Attribute attr = type.getAttribute(currentAttributeIdx + 1);
    if (attr == null) {
      throw new SQLException("invalid attribute access");
    }

    Class<?> targetType = mapSetType(attr.type);
View Full Code Here

        Object[] attributeVals = new Object[itemCount];

        for (int c = 0; c < itemCount; ++c) {

          Attribute attribute = compType.getAttribute(c + 1);

          Type attributeType = context.getRegistry().loadType(buffer.readInt());

          if (attributeType.getId() != attribute.type.getId()) {
View Full Code Here

      Object[] vals = val.getValues();

      for (int c = 0; c < vals.length; ++c) {

        Attribute attr = type.getAttribute(c + 1);

        Codec codec = attr.type.getCodec(Format.Text);

        StringBuilder attrOut = new StringBuilder();
View Full Code Here

    List<Attribute> attrs = type.getAttributes();

    for (int c = 0; c < attrs.size(); c++) {

      Attribute attr = attrs.get(c);

      Class<?> targetType = mapGetType(attr.type, map, connection);

      newValues[c] = coerce(values[c], attr.type, targetType, map, connection);
    }
View Full Code Here

TOP

Related Classes of com.impossibl.postgres.types.CompositeType.Attribute

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.