@Test public void testGetCompositeUniqueKeyDesc() throws Exception { UniqueConstraint[] uniqueConstraints = Aaa.class.getAnnotation( Table.class).uniqueConstraints(); UniqueKeyDesc uniqueKeyDesc = factory .getCompositeUniqueKeyDesc(uniqueConstraints[0]); assertNotNull(uniqueKeyDesc); assertEquals(2, uniqueKeyDesc.getColumnNameList().size()); assertEquals("aaa", uniqueKeyDesc.getColumnNameList().get(0)); assertEquals("bbb", uniqueKeyDesc.getColumnNameList().get(1)); uniqueKeyDesc = factory.getCompositeUniqueKeyDesc(uniqueConstraints[1]); assertNull(uniqueKeyDesc); }
public UniqueKeyDesc getCompositeUniqueKeyDesc( UniqueConstraint uniqueConstraint) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); for (String columnName : uniqueConstraint.columnNames()) { uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; }
UniqueKeyDescFactoryImpl implements UniqueKeyDescFactory { public UniqueKeyDesc getCompositeUniqueKeyDesc( UniqueConstraint uniqueConstraint) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); for (String columnName : uniqueConstraint.columnNames()) { uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; } }
UniqueKeyDescFactoryImpl implements UniqueKeyDescFactory { public UniqueKeyDesc getCompositeUniqueKeyDesc( UniqueConstraint uniqueConstraint) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); for (String columnName : uniqueConstraint.columnNames()) { uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; } UniqueKeyDescFactoryImpl(GenDialect dialect); }
UniqueKeyDescFactoryImpl implements UniqueKeyDescFactory { public UniqueKeyDesc getCompositeUniqueKeyDesc( UniqueConstraint uniqueConstraint) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); for (String columnName : uniqueConstraint.columnNames()) { uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; } UniqueKeyDescFactoryImpl(GenDialect dialect); UniqueKeyDesc getCompositeUniqueKeyDesc(
            UniqueConstraint uniqueConstraint); UniqueKeyDesc getSingleUniqueKeyDesc(ColumnDesc columnDesc); }
UniqueKeyDescFactoryImpl implements UniqueKeyDescFactory { public UniqueKeyDesc getCompositeUniqueKeyDesc( UniqueConstraint uniqueConstraint) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); for (String columnName : uniqueConstraint.columnNames()) { uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; } UniqueKeyDescFactoryImpl(GenDialect dialect); UniqueKeyDesc getCompositeUniqueKeyDesc(
            UniqueConstraint uniqueConstraint); UniqueKeyDesc getSingleUniqueKeyDesc(ColumnDesc columnDesc);  }