Examples of discriminatorType()


Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

    AmberType columnType = null;
    DiscriminatorType discType = DiscriminatorType.STRING;

    if (discriminatorAnn != null)
      discType = discriminatorAnn.discriminatorType();

    switch (discType) {
    case STRING:
      columnType = StringType.create();
      break;
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

        }
      }

      if ( generateDiscriminatorColumn ) {
        final DiscriminatorType discriminatorType = discriminatorColumnAnnotation != null
            ? discriminatorColumnAnnotation.discriminatorType()
            : DiscriminatorType.STRING;
        return Ejb3DiscriminatorColumn.buildDiscriminatorColumn(
            discriminatorType,
            discriminatorColumnAnnotation,
            null,
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

    }
    DiscriminatorColumn da = (DiscriminatorColumn) cls.getAnnotation(DiscriminatorColumn.class);
    if (da != null) {
      // lowercase the discriminator column for RawSql and JSON
      info.setDiscriminatorColumn(da.name().toLowerCase());
      DiscriminatorType discriminatorType = da.discriminatorType();
      if (discriminatorType.equals(DiscriminatorType.INTEGER)){
        info.setDiscriminatorType(Types.INTEGER);       
      } else {
        info.setDiscriminatorType(Types.VARCHAR);
      }
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

                    attr.setTrue(Flag.Insertable);
                    attr.setTrue(Flag.DaoGenerated);
                    attr.setTrue(Flag.DC);
                    _attributes.add(attr);
                }
                if (column.discriminatorType() == DiscriminatorType.CHAR) {
                    attr.setTrue(Attribute.Flag.CharDT);
                } else if (column.discriminatorType() == DiscriminatorType.STRING) {
                    attr.setTrue(Attribute.Flag.StringDT);
                } else if (column.discriminatorType() == DiscriminatorType.INTEGER) {
                    attr.setTrue(Attribute.Flag.IntegerDT);
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

                    attr.setTrue(Flag.DC);
                    _attributes.add(attr);
                }
                if (column.discriminatorType() == DiscriminatorType.CHAR) {
                    attr.setTrue(Attribute.Flag.CharDT);
                } else if (column.discriminatorType() == DiscriminatorType.STRING) {
                    attr.setTrue(Attribute.Flag.StringDT);
                } else if (column.discriminatorType() == DiscriminatorType.INTEGER) {
                    attr.setTrue(Attribute.Flag.IntegerDT);
                }
            }
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

                }
                if (column.discriminatorType() == DiscriminatorType.CHAR) {
                    attr.setTrue(Attribute.Flag.CharDT);
                } else if (column.discriminatorType() == DiscriminatorType.STRING) {
                    attr.setTrue(Attribute.Flag.StringDT);
                } else if (column.discriminatorType() == DiscriminatorType.INTEGER) {
                    attr.setTrue(Attribute.Flag.IntegerDT);
                }
            }

            PrimaryKeyJoinColumn[] pkjcs = DbUtil.getPrimaryKeyJoinColumns(current);
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

                assert(dc != null) : "Parent does not have discrminator column: " + parent.getName();
                sql.append(tableName);
                sql.append(".");
                sql.append(dc.name()).append("=");
                Object value = null;
                if (dc.discriminatorType() == DiscriminatorType.INTEGER) {
                    sql.append(dv.value());
                    value = Integer.parseInt(dv.value());
                } else if (dc.discriminatorType() == DiscriminatorType.CHAR) {
                    sql.append(dv.value());
                    value = dv.value().charAt(0);
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

                sql.append(dc.name()).append("=");
                Object value = null;
                if (dc.discriminatorType() == DiscriminatorType.INTEGER) {
                    sql.append(dv.value());
                    value = Integer.parseInt(dv.value());
                } else if (dc.discriminatorType() == DiscriminatorType.CHAR) {
                    sql.append(dv.value());
                    value = dv.value().charAt(0);
                } else if (dc.discriminatorType() == DiscriminatorType.STRING) {
                    String v = dv.value();
                    v = v.substring(0, v.length() < dc.length() ? v.length() : dc.length());
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

                    sql.append(dv.value());
                    value = Integer.parseInt(dv.value());
                } else if (dc.discriminatorType() == DiscriminatorType.CHAR) {
                    sql.append(dv.value());
                    value = dv.value().charAt(0);
                } else if (dc.discriminatorType() == DiscriminatorType.STRING) {
                    String v = dv.value();
                    v = v.substring(0, v.length() < dc.length() ? v.length() : dc.length());
                    sql.append("'").append(v).append("'");
                    value = v;
                }
View Full Code Here

Examples of javax.persistence.DiscriminatorColumn.discriminatorType()

    cfMapDef.setInheritanceType(InheritanceType.SINGLE_TABLE);

    DiscriminatorColumn discriminatorCol = clazz.getAnnotation(DiscriminatorColumn.class);
    if (null != discriminatorCol) {
      cfMapDef.setDiscColumn(discriminatorCol.name());
      cfMapDef.setDiscType(discriminatorCol.discriminatorType());
    }
    else {
      cfMapDef.setDiscType(DiscriminatorType.STRING);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.