Code example for Column

Methods: equalsgetCanonicalName

0
 
	public void testScalePrecisionLength() { 
 
		Table table = getTable( identifier( "basic" ) );
 
		Column nameCol = table.getColumn( new Column( identifier( "name" ) ) );
		assertEquals( nameCol.getLength(), 20 );
		assertEquals( nameCol.getPrecision(), Column.DEFAULT_PRECISION );
		assertEquals( nameCol.getScale(), Column.DEFAULT_SCALE );
	} 
 
	 
/*	public void testAutoDetectSingleSchema() { 
		 
		//read single schema without default schema: result = no schema info in tables. 
		JDBCMetaDataConfiguration mycfg = new JDBCMetaDataConfiguration(); 
		mycfg.setReverseEngineeringStrategy(new DelegatingReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()) { 
			public boolean excludeTable(TableIdentifier ti) { 
				return !"PUBLIC".equals(ti.getSchema());				 
			} 
		}); 
		mycfg.getProperties().remove(org.hibernate.cfg.Environment.DEFAULT_SCHEMA); 
		mycfg.readFromJDBC();			 
		 
		Table table = getTable(mycfg, identifier("otherschema")); 
		assertNull("rev.eng.strategy should have excluded this table",table); 
		 
		table = getTable(mycfg, identifier("basic")); 
		assertNotNull(table); 
		assertNull(table.getSchema()); 
		 
		 
		//read single schema with default schema: result = no schema info in tables. 
		 
		//read other single schema than default schema: result = schema info in tables. 
		 
	}*/ 
	 
	/* 
	 * public void testGetTables() { 
	 *  
	 * Table table = new Table(); table.setName("dummy"); cfg.addTable(table); 
	 *  
	 * Table foundTable = cfg.getTable(null,null,"dummy"); 
	 *  
	 * assertSame(table,foundTable); 
	 *  
	 * foundTable = cfg.getTable(null,"dschema", "dummy"); 
	 *  
	 * assertNotSame(table, foundTable); } 
	 */ 
 
	public void testCompositeKeys() { 
 
		Table table = getTable( identifier( "multikeyed" ) );
 
		PrimaryKey primaryKey = table.getPrimaryKey();
 
		assertEquals( 2, primaryKey.getColumnSpan() );
	} 
 
	public static Test suite() {
		return new TestSuite( BasicMultiSchemaTest.class );
	} 
 
}