예제 #1
0
  @Before
  public void init() throws Exception {
    final Vdb vdb = createVdb();
    final Model model = createModel();
    this.parentTable = model.addTable(getTransaction(), "parentTable");

    final Model refModel = vdb.addModel(getTransaction(), "refModel");
    this.refTable = refModel.addTable(getTransaction(), "refTable");

    this.foreignKey = this.parentTable.addForeignKey(getTransaction(), NAME, this.refTable);
    commit();
  }
예제 #2
0
 protected Table createTable(
     final String vdbName, final String vdbPath, final String modelName, final String tableName)
     throws Exception {
   final WorkspaceManager mgr = WorkspaceManager.getInstance(_repo);
   final Vdb vdb = mgr.createVdb(this.uow, null, vdbName, vdbPath);
   final Model model = vdb.addModel(this.uow, modelName);
   return model.addTable(this.uow, tableName);
 }