Hibernate ORM Column - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM Column class.

This code example shows how to use the following methods: equals, getCanonicalName, isUnique
		assertNotNull(uniqueKey);
		 
		assertEquals(1, uniqueKey.getColumnSpan() );
		 
		Column keyCol = uniqueKey.getColumn(0);
		assertTrue(keyCol.isUnique() );
		 
		assertSame(keyCol, table.getColumn(keyCol) );
		 
	} 
	 
	public void testWithIndex() { 
		 
		Table table = getTable(identifier("withIndex") );
		 
		assertEqualIdentifiers("withIndex", table.getName() );
		 
		assertNull("there should be no pk", table.getPrimaryKey() );
		Iterator iterator = table.getIndexIterator();
	 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: equals, getCanonicalName
		 
		assertFalse("should only be one fk", iterator.hasNext() );
		 
		assertEquals(1, fk.getColumnSpan() );
		 
		assertSame(fk.getColumn(0), child.getColumn(new Column(identifier("masterref") ) ) );
		 
		 
	} 
 
	 
	 
	 
	public void testExport() { 
		 
		new SchemaExport(cfg).create(true, false);
		 
	} 
	 
	public static Test suite() {

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: equals, getCanonicalName
 
	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 testGetTables() { 
	 *  
	 * Table table = new Table(); table.setName("dummy"); cfg.addTable(table); 
	 *  
	 * Table foundTable = cfg.getTable(null,null,"dummy"); 
	 *  
	 * assertSame(table,foundTable); 
	 *  

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: equals, getCanonicalName
 
	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 testGetTables() { 
	 *  
	 * Table table = new Table(); table.setName("dummy"); cfg.addTable(table); 
	 *  
	 * Table foundTable = cfg.getTable(null,null,"dummy"); 
	 *  
	 * assertSame(table,foundTable); 
	 *  

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getLength, getName, getPrecision, getScale, getSqlType
			annotations.append("@").append( importType("org.hibernate.annotations.Formula") )
					.append("(value=\"" ).append( selectable.getText() ).append( "\")" );
		} 
		else { 
			Column column = (Column) selectable;
			annotations.append( "@" + importType("javax.persistence.Column") + "(name=\"" ).append( column.getName() ).append( "\"" );
			 
			appendCommonColumnInfo( annotations, column, insertable, updatable );
			 
			if (column.getPrecision() != Column.DEFAULT_PRECISION) { // the default is actually 0 in spec
				annotations.append( ", precision=" ).append( column.getPrecision() );
			} 
			if (column.getScale() != Column.DEFAULT_SCALE) { // default is actually 0 in spec
				annotations.append( ", scale=" ).append( column.getScale() );
			} 
			else if (column.getLength() != 255){ 
				annotations.append( ", length=" ).append( column.getLength() );
			} 
			 
					 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE