Examples of needsToString()


Examples of org.hibernate.tool.hbm2x.pojo.POJOClass.needsToString()

  public void testToString() {
    Cfg2JavaTool c2j = new Cfg2JavaTool();

    PersistentClass pc = getCfg().getClassMapping( "HelloWorld" );
    POJOClass pjc = c2j.getPOJOClass(pc);
    assertTrue( pjc.needsToString() );
    Iterator iter = pjc.getToStringPropertiesIterator();

    // in HelloWorld.hbm.xml there're 2 Properties for toString
    assertEquals( "id", ((Property) iter.next() ).getName() );
    assertEquals( "hello", ((Property) iter.next() ).getName() );
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass.needsToString()

    assertEquals( "hello", ((Property) iter.next() ).getName() );
    assertFalse( iter.hasNext() );

    pc = getCfg().getClassMapping( "org.hibernate.tool.hbm2x.Order" );
    pjc = c2j.getPOJOClass(pc);
    assertFalse( pjc.needsToString() );

    pc = getCfg().getClassMapping( "org.hibernate.tool.hbm2x.Customer" );
    Component c = (Component) pc.getProperty( "addressComponent" )
        .getValue();   
    POJOClass cc = c2j.getPOJOClass(c);
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.POJOClass.needsToString()

    pc = getCfg().getClassMapping( "org.hibernate.tool.hbm2x.Customer" );
    Component c = (Component) pc.getProperty( "addressComponent" )
        .getValue();   
    POJOClass cc = c2j.getPOJOClass(c);
    assertTrue( cc.needsToString() );
    iter = cc.getToStringPropertiesIterator();
   
    // in Customer.hbm.xml there's 1 Property for toString
    assertEquals( "city", ((Property) iter.next() ).getName() );
    assertFalse( iter.hasNext() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.