Package com.avaje.ebean.config

Examples of com.avaje.ebean.config.TableName


  private void setTableName() {

    if (descriptor.isBaseTableType()) {

      // default the TableName using NamingConvention.
      TableName tableName = namingConvention.getTableName(descriptor.getBeanType());

      descriptor.setBaseTable(tableName);
    }
  }
View Full Code Here


  }

 
  private String getM2MJoinTableName(BeanTable lhsTable, BeanTable rhsTable){
   
    TableName lhs = new TableName(lhsTable.getBaseTable());
    TableName rhs = new TableName(rhsTable.getBaseTable());
   
    TableName joinTable = namingConvention.getM2MJoinTableName(lhs, rhs);
   
    return joinTable.getQualifiedName();
  }
View Full Code Here

public class TestTableName extends BaseTestCase {

  @Test
  public void test() {
   
    TableName t = new TableName("a");
    Assert.assertEquals("a", t.getName());
    Assert.assertNull(t.getCatalog());
    Assert.assertNull(t.getSchema());

    t = new TableName("b.a");
    Assert.assertEquals("a", t.getName());
    Assert.assertEquals("b", t.getSchema());
    Assert.assertNull(t.getCatalog());

    t = new TableName("c.b.a");
    Assert.assertEquals("a", t.getName());
    Assert.assertEquals("b", t.getSchema());
    Assert.assertEquals("c", t.getCatalog());
   
//    try {
//      TableName t2 = new TableName("d.c.b.a");
//      Assert.assertNotNull(t2);
//      Assert.assertTrue(false);
View Full Code Here

    /**
     * Parse the annotations.
     */
    public void parse() {
     
      TableName tableName = namingConvention.getTableName(beanTable.getBeanType());

    beanTable.setBaseTable(tableName.getQualifiedName());
    }
View Full Code Here

TOP

Related Classes of com.avaje.ebean.config.TableName

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.