Package javax.persistence

Examples of javax.persistence.Column.nullable()


                                    null, "persistent", null, null, null, null, null, null, null, null, null, null, null, null,
                                    null, null, null, null, null, null);
                                Column col = overrides[j].column();
                                // TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
                                fmd.addColumn(new ColumnMetaData(fmd, col.name(), null, null, null, null,
                                    "" + col.length(), "" + col.scale(), "" + col.nullable(), null, null,
                                    "" + col.insertable(), "" + col.updatable(), "" + col.unique()));
                                overriddenFields.add(fmd);
                            }
                        }
                    }
View Full Code Here


                            null, null, null, null, null, null, null, null, null, null, null, null, null, null,
                            null, null, null, null, null, null);
                        Column col = (Column)annotationValues.get("column");
                        // TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
                        fmd.addColumn(new ColumnMetaData(fmd, col.name(), null, null, null, null,
                            "" + col.length(), "" + col.scale(), "" + col.nullable(), null, null,
                            "" + col.insertable(), "" + col.updatable(), "" + col.unique()));
                        overriddenFields.add(fmd);
                    }
                    else if (annName.equals(JPAAnnotationUtils.ASSOCIATION_OVERRIDES))
                    {
View Full Code Here

                                // TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
                                ColumnMetaData colmd = new ColumnMetaData();
                                colmd.setName(col.name());
                                colmd.setLength(col.length());
                                colmd.setScale(col.scale());
                                colmd.setAllowsNull(col.nullable());
                                colmd.setInsertable(col.insertable());
                                colmd.setUpdateable(col.updatable());
                                colmd.setUnique(col.unique());
                                fmd.addColumn(colmd);
                                overriddenFields.add(fmd);
View Full Code Here

                        // TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
                        ColumnMetaData colmd = new ColumnMetaData();
                        colmd.setName(col.name());
                        colmd.setLength(col.length());
                        colmd.setScale(col.scale());
                        colmd.setAllowsNull(col.nullable());
                        colmd.setInsertable(col.insertable());
                        colmd.setUpdateable(col.updatable());
                        colmd.setUnique(col.unique());
                        fmd.addColumn(colmd);
                        overriddenFields.add(fmd);
View Full Code Here

        }

        // handling nullability only if other explicit validation annotations do not exist.
        if (!contains(annotations, NotNull.class) &&
            (!LibraryUtils.HIBERNATE_VALIDATOR_IN_CLASSPATH || !contains(annotations, org.hibernate.validator.NotNull.class))) {
            if (!column.nullable()) {
                PropertyValidationRule propertyRule = new PropertyValidationRule(descriptor.getName(), new NotNullValidationRule());
                configuration.addPropertyRule(descriptor.getName(), propertyRule);
            }
        }
View Full Code Here

    assertAnnotationPresent( ElementCollection.class );
    assertAnnotationPresent( Column.class );
    Column column = reader.getAnnotation( Column.class );
    assertEquals( "", column.name() );
    assertFalse( column.unique() );
    assertTrue( column.nullable() );
    assertTrue( column.insertable() );
    assertTrue( column.updatable() );
    assertEquals( "", column.columnDefinition() );
    assertEquals( "", column.table() );
    assertEquals( 255, column.length() );
View Full Code Here

    assertAnnotationPresent( ElementCollection.class );
    assertAnnotationPresent( Column.class );
    Column column = reader.getAnnotation( Column.class );
    assertEquals( "col1", column.name() );
    assertTrue( column.unique() );
    assertFalse( column.nullable() );
    assertFalse( column.insertable() );
    assertFalse( column.updatable() );
    assertEquals( "int", column.columnDefinition() );
    assertEquals( "table1", column.table() );
    assertEquals( 50, column.length() );
View Full Code Here

                                                columnDefinition.equals(ColumnDefinitions.TINYINT)) {
                                            definition = (column.length() != 0) ? column.name() + " " + object + "(" +column.length() + ") " : column.name() + " " + object;
                                        }

                                        definition =  column.name() + " " + object;
                                        definition = (!column.nullable()) ? definition + " NOT NULL, " : definition + ",";
                                        if (column.name().equals("ID")) {
                                            definition = column.name() + " INT PRIMARY KEY NOT NULL, ";
                                        }

                                        createTableBuilder.append(definition);
View Full Code Here

      p.setColumn(column);
      p.setType(f.getType().getName());
      p.setNotNull("true");
      if (colAnn != null) {
        // int size = colAnn.length();
        p.setNotNull(String.valueOf(colAnn.nullable()));
        p.setUnique(String.valueOf(colAnn.unique()));
      }

      if (ClassUtil.isPojo(f.getType())) {
        OneToOne oneAnn = getter.getAnnotation(OneToOne.class);
View Full Code Here

        if (!isId())
        {
            Column anno = member.getAnnotation(Column.class);
            if (anno != null)
            {
                isNullable = anno.nullable();
            }
        }
        else
        {
            isNullable = false;
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.