Code example for Column

Methods: getLengthisNullable

0
	public void testBasicDDL() { 
		PersistentClass classMapping = configuration().getClassMapping( Address.class.getName() );
		Column stateColumn = (Column) classMapping.getProperty( "state" ).getColumnIterator().next();
		assertEquals( stateColumn.getLength(), 3 );
		Column zipColumn = (Column) classMapping.getProperty( "zip" ).getColumnIterator().next();
		assertEquals( zipColumn.getLength(), 5 );
		assertFalse( zipColumn.isNullable() );
	} 
 
	@Test
	public void testApplyOnIdColumn() throws Exception {
		PersistentClass classMapping = configuration().getClassMapping( Tv.class.getName() );
		Column serialColumn = (Column) classMapping.getIdentifierProperty().getColumnIterator().next();
		assertEquals( "Validator annotation not applied on ids", 2, serialColumn.getLength() );
	} 
 
	@Test
	@TestForIssue( jiraKey = "HHH-5281" ) 
	public void testLengthConstraint() throws Exception {
		PersistentClass classMapping = configuration().getClassMapping( Tv.class.getName() );
Contextual code suggestions in your IDE  Get Codota for Java