@Test public void testGetCompositeUniqueConstraintDescList() throws Exception { DbUniqueKeyMeta ukMeta1 = new DbUniqueKeyMeta(); ukMeta1.addColumnName("AAA"); ukMeta1.addColumnName("BBB"); DbUniqueKeyMeta ukMeta2 = new DbUniqueKeyMeta(); ukMeta2.addColumnName("CCC"); ukMeta2.addColumnName("DDD"); DbUniqueKeyMeta ukMeta3 = new DbUniqueKeyMeta(); ukMeta3.addColumnName("EEE"); DbTableMeta tableMeta = new DbTableMeta(); tableMeta.setName("HOGE"); tableMeta.addUniqueKeyMeta(ukMeta1); tableMeta.addUniqueKeyMeta(ukMeta2); tableMeta.addUniqueKeyMeta(ukMeta3); EntityDesc entityDesc = factory.getEntityDesc(tableMeta); assertEquals(2, entityDesc.getCompositeUniqueConstraintDescList() .size()); CompositeUniqueConstraintDesc compositeUniqueConstraintDesc = entityDesc .getCompositeUniqueConstraintDescList().get(0); assertEquals(Arrays.asList("AAA", "BBB"), compositeUniqueConstraintDesc .getColumnNameList()); compositeUniqueConstraintDesc = entityDesc .getCompositeUniqueConstraintDescList().get(1); assertEquals(Arrays.asList("CCC", "DDD"), compositeUniqueConstraintDesc .getColumnNameList()); }
public EntityDesc getEntityDesc(DbTableMeta tableMeta) { EntityDesc entityDesc = new EntityDesc(); doName(tableMeta, entityDesc); doTable(tableMeta, entityDesc); doAttributeDesc(tableMeta, entityDesc); doCompositeUniqueConstraintDesc(tableMeta, entityDesc); return entityDesc; }
EntityDescFactoryImpl implements EntityDescFactory { public EntityDesc getEntityDesc(DbTableMeta tableMeta) { EntityDesc entityDesc = new EntityDesc(); doName(tableMeta, entityDesc); doTable(tableMeta, entityDesc); doAttributeDesc(tableMeta, entityDesc); doCompositeUniqueConstraintDesc(tableMeta, entityDesc); return entityDesc; } }
EntityDescFactoryImpl implements EntityDescFactory { public EntityDesc getEntityDesc(DbTableMeta tableMeta) { EntityDesc entityDesc = new EntityDesc(); doName(tableMeta, entityDesc); doTable(tableMeta, entityDesc); doAttributeDesc(tableMeta, entityDesc); doCompositeUniqueConstraintDesc(tableMeta, entityDesc); return entityDesc; } EntityDescFactoryImpl(
            PersistenceConvention persistenceConvention,
            AttributeDescFactory attributeDescFactory,
            CompositeUniqueConstraintDescFactory compositeUniqueConstraintDescFactory); }
EntityDescFactoryImpl implements EntityDescFactory { public EntityDesc getEntityDesc(DbTableMeta tableMeta) { EntityDesc entityDesc = new EntityDesc(); doName(tableMeta, entityDesc); doTable(tableMeta, entityDesc); doAttributeDesc(tableMeta, entityDesc); doCompositeUniqueConstraintDesc(tableMeta, entityDesc); return entityDesc; } EntityDescFactoryImpl(
            PersistenceConvention persistenceConvention,
            AttributeDescFactory attributeDescFactory,
            CompositeUniqueConstraintDescFactory compositeUniqueConstraintDescFactory); EntityDesc getEntityDesc(DbTableMeta tableMeta); }
EntityDescFactoryImpl implements EntityDescFactory { public EntityDesc getEntityDesc(DbTableMeta tableMeta) { EntityDesc entityDesc = new EntityDesc(); doName(tableMeta, entityDesc); doTable(tableMeta, entityDesc); doAttributeDesc(tableMeta, entityDesc); doCompositeUniqueConstraintDesc(tableMeta, entityDesc); return entityDesc; } EntityDescFactoryImpl(
            PersistenceConvention persistenceConvention,
            AttributeDescFactory attributeDescFactory,
            CompositeUniqueConstraintDescFactory compositeUniqueConstraintDescFactory); EntityDesc getEntityDesc(DbTableMeta tableMeta);  }