Examples of ColumnValues


Examples of org.apache.torque.util.ColumnValues

     */
    public void testDoUpdateBooleanFalseValue() throws Exception
    {
        // prepare
        fillTables();
        ColumnValues columnValues = new ColumnValues();
        columnValues.put(
                BintBcharTypePeer.ID,
                new JdbcTypedValue("t1", Types.VARCHAR));
        columnValues.put(
                BintBcharTypePeer.BINT_VALUE,
                new JdbcTypedValue(Boolean.FALSE, Types.BIT));
        columnValues.put(
                BintBcharTypePeer.BCHAR_VALUE,
                new JdbcTypedValue(Boolean.FALSE, Types.BIT));
        columnValues.put(
                BintBcharTypePeer.BINT_OBJECT_VALUE,
                new JdbcTypedValue(Boolean.FALSE, Types.BIT));
        columnValues.put(
                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                new JdbcTypedValue(Boolean.FALSE, Types.BIT));

        // execute
        BintBcharTypePeer.doUpdate(columnValues);
View Full Code Here

Examples of org.apache.torque.util.ColumnValues

     */
    public void testGetColumnValuesNewUnchangedObject() throws Exception
    {
        DatabaseDefaultValues databaseDefaultValues
                = new DatabaseDefaultValues();
        ColumnValues columnValues
                = DatabaseDefaultValuesPeer.buildColumnValues(
                        databaseDefaultValues);
        assertEquals(1, columnValues.size());
        assertEquals(
                columnValues.get(DatabaseDefaultValuesPeer.NORMAL_PAYLOAD),
                new JdbcTypedValue(0, Types.INTEGER));
    }
View Full Code Here

Examples of org.apache.torque.util.ColumnValues

     */
    public void testDoUpdateNativeFalseValue() throws Exception
    {
        // prepare
        fillTables();
        ColumnValues columnValues = new ColumnValues();
        columnValues.put(
                BintBcharTypePeer.ID,
                new JdbcTypedValue("t1", Types.VARCHAR));
        columnValues.put(
                BintBcharTypePeer.BINT_VALUE,
                new JdbcTypedValue(0, Types.INTEGER));
        columnValues.put(
                BintBcharTypePeer.BCHAR_VALUE,
                new JdbcTypedValue("N", Types.CHAR));
        columnValues.put(
                BintBcharTypePeer.BINT_OBJECT_VALUE,
                new JdbcTypedValue(0, Types.INTEGER));
        columnValues.put(
                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                new JdbcTypedValue("N", Types.CHAR));

        // execute
        BintBcharTypePeer.doUpdate(columnValues);
View Full Code Here

Examples of org.apache.trevni.ColumnValues

    reader.close();
  }
 
  private void valueToJson(ColumnMetaData column) throws IOException {
    generator.writeFieldName(shortNames[column.getNumber()]);
    ColumnValues in = values[column.getNumber()];
    if (!column.isArray()) {
      primitiveToJson(column, in.nextValue());
    } else {
      generator.writeStartArray();
      int length = in.nextLength();
      for (int i = 0; i < length; i++) {
        Object value = in.nextValue();
        List<ColumnMetaData> children = column.getChildren();
        if (children.size() == 0) {
          primitiveToJson(column, value);
        } else {
          generator.writeStartObject();
View Full Code Here

Examples of org.apache.trevni.ColumnValues

    reader.close();
  }
 
  private void valueToJson(ColumnMetaData column) throws IOException {
    generator.writeFieldName(shortNames[column.getNumber()]);
    ColumnValues in = values[column.getNumber()];
    if (!column.isArray()) {
      primitiveToJson(column, in.nextValue());
    } else {
      generator.writeStartArray();
      int length = in.nextLength();
      for (int i = 0; i < length; i++) {
        Object value = in.nextValue();
        List<ColumnMetaData> children = column.getChildren();
        if (children.size() == 0) {
          primitiveToJson(column, value);
        } else {
          generator.writeStartObject();
View Full Code Here

Examples of org.apache.trevni.ColumnValues

    reader.close();
  }
 
  private void valueToJson(ColumnMetaData column) throws IOException {
    generator.writeFieldName(shortNames[column.getNumber()]);
    ColumnValues in = values[column.getNumber()];
    if (!column.isArray()) {
      primitiveToJson(column, in.nextValue());
    } else {
      generator.writeStartArray();
      int length = in.nextLength();
      for (int i = 0; i < length; i++) {
        Object value = in.nextValue();
        List<ColumnMetaData> children = column.getChildren();
        if (children.size() == 0) {
          primitiveToJson(column, value);
        } else {
          generator.writeStartObject();
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.ColumnValues

  private String comment;
  private Set<String> uniqueKeys = new HashSet<String>();
  private Set<String> indexes = new HashSet<String>();

  public AttributeColumnRelationalState(MappedAttribute attribute, MetadataImpl meta) {
    ColumnValues columnValues = attribute.getColumnValues();
    namingStrategy = meta.getNamingStrategy();
    columnName = columnValues.getName().isEmpty() ? attribute.getName() : columnValues.getName();
    unique = columnValues.isUnique();
    nullable = columnValues.isNullable();
    size = createSize( columnValues.getLength(), columnValues.getScale(), columnValues.getPrecision() );

    List<AnnotationInstance> checkAnnotations = attribute.annotations( HibernateDotNames.CHECK );
    if ( checkAnnotations.size() > 1 ) {
      throw new AssertionFailure( "There cannot be more than one @Check annotation per mapped attribute" );
    }
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.attribute.ColumnValues

    Class<?> type = String.class; // string is the discriminator default
    if ( discriminatorFormulaAnnotation != null ) {
      String expression = JandexHelper.getValue( discriminatorFormulaAnnotation, "value", String.class );
      discriminatorFormula = new FormulaValue( getPrimaryTableSource().getExplicitTableName(), expression );
    }
    discriminatorColumnValues = new ColumnValues( null ); //(stliu) give null here, will populate values below
    discriminatorColumnValues.setNullable( false ); // discriminator column cannot be null
    if ( discriminatorColumnAnnotation != null ) {

      DiscriminatorType discriminatorType = Enum.valueOf(
          DiscriminatorType.class, discriminatorColumnAnnotation.value( "discriminatorType" ).asEnum()
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.attribute.ColumnValues

    Class<?> type = String.class; // string is the discriminator default
    if ( discriminatorFormulaAnnotation != null ) {
      String expression = JandexHelper.getValue( discriminatorFormulaAnnotation, "value", String.class );
      discriminatorFormula = new FormulaValue( getPrimaryTableSource().getExplicitTableName(), expression );
    }
    discriminatorColumnValues = new ColumnValues( null ); //(stliu) give null here, will populate values below
    discriminatorColumnValues.setNullable( false ); // discriminator column cannot be null
    if ( discriminatorColumnAnnotation != null ) {

      DiscriminatorType discriminatorType = Enum.valueOf(
          DiscriminatorType.class, discriminatorColumnAnnotation.value( "discriminatorType" ).asEnum()
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.attribute.ColumnValues

    Class<?> type = String.class; // string is the discriminator default
        if ( discriminatorFormulaAnnotation != null ) {
            String expression = JandexHelper.getValue( discriminatorFormulaAnnotation, "value", String.class );
            discriminatorFormula = new FormulaValue( getPrimaryTableSource().getExplicitTableName(), expression );
        }
         discriminatorColumnValues = new ColumnValues( null ); //(stliu) give null here, will populate values below
            discriminatorColumnValues.setNullable( false ); // discriminator column cannot be null
    if ( discriminatorColumnAnnotation != null ) {

      DiscriminatorType discriminatorType = Enum.valueOf(
          DiscriminatorType.class, discriminatorColumnAnnotation.value( "discriminatorType" ).asEnum()
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.