Package org.hibernate.cfg.reveng

Examples of org.hibernate.cfg.reveng.SQLTypeMapping


   
  }
 

  public void testSQLTypeMappingComparisons() {
    SQLTypeMapping one = new SQLTypeMapping(Types.BIGINT, 5, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE,SQLTypeMapping.UNKNOWN_NULLABLE);
    SQLTypeMapping two = new SQLTypeMapping(Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, 3, SQLTypeMapping.UNKNOWN_SCALE, SQLTypeMapping.UNKNOWN_NULLABLE);
    SQLTypeMapping generic = new SQLTypeMapping(Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, SQLTypeMapping.UNKNOWN_NULLABLE);
    SQLTypeMapping specific = new SQLTypeMapping(Types.BIGINT, 2, 3, 4, SQLTypeMapping.UNKNOWN_NULLABLE);
    SQLTypeMapping morespecific = new SQLTypeMapping(Types.BIGINT, 2, 3, 4, Boolean.TRUE);
    SQLTypeMapping equalmorespecific = new SQLTypeMapping(Types.BIGINT, 2, 3, 4, Boolean.TRUE);
   
    assertFalse(one.equals(two) );
    assertFalse(two.equals(one) );
    assertTrue(two.equals(two) );
    assertTrue(one.equals(one) );
View Full Code Here


  }
  public void testSqlTypeOverride() {
   
    OverrideRepository or = buildOverrideRepository();
   
    SQLTypeMapping sqltype = new SQLTypeMapping(Types.BINARY);
   
    sqltype.setLength(1);
    sqltype.setHibernateType("boolean");
    or.addTypeMapping(sqltype);
   
    sqltype = new SQLTypeMapping(Types.BIT);
   
    sqltype.setHibernateType("yes_no");
    or.addTypeMapping(sqltype);
   
    ReverseEngineeringStrategy res = or.getReverseEngineeringStrategy(null);
    assertEquals("boolean",res.columnToHibernateTypeName(null,null, Types.BINARY, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) );
    assertEquals(null,res.columnToHibernateTypeName(null,null, Types.LONGVARCHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) );
View Full Code Here

TOP

Related Classes of org.hibernate.cfg.reveng.SQLTypeMapping

Copyright © 2018 www.massapicom. 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.