Code example for Column

Methods: getName

0
 
	@Test
	public void testDatabaseColumnNames() { 
		PersistentClass classMapping = configuration().getClassMapping( Customers.class.getName() );
		Column stateColumn = (Column) classMapping.getProperty( "specified_column" ).getColumnIterator().next();
		assertEquals( "CN_specified_column", stateColumn.getName() );
	} 
 
    @Test
    @TestForIssue(jiraKey = "HHH-5848") 
    public void testDatabaseTableNames() { 
        PersistentClass classMapping = configuration().getClassMapping( Item.class.getName() );
        Column secTabColumn = (Column) classMapping.getProperty( "specialPrice" ).getColumnIterator().next();
        assertEquals( "TAB_ITEMS_SEC", secTabColumn.getValue().getTable().getName() );
        Column tabColumn = (Column) classMapping.getProperty( "price" ).getColumnIterator().next();
        assertEquals( "TAB_ITEMS", tabColumn.getValue().getTable().getName() );
    } 
}