@Test public void testGetSingleUniqueKeyDesc() throws Exception { ColumnDesc columnDesc = new ColumnDesc(); columnDesc.setName("aaa"); columnDesc.setUnique(true); UniqueKeyDesc uniqueKeyDesc = factory .getSingleUniqueKeyDesc(columnDesc); assertNotNull(uniqueKeyDesc); assertEquals(1, uniqueKeyDesc.getColumnNameList().size()); assertEquals("aaa", uniqueKeyDesc.getColumnNameList().get(0)); columnDesc.setUnique(false); uniqueKeyDesc = factory.getSingleUniqueKeyDesc(columnDesc); assertNull(uniqueKeyDesc); }
public UniqueKeyDesc getSingleUniqueKeyDesc(ColumnDesc columnDesc) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); if (columnDesc.isUnique()) { String columnName = columnDesc.getName(); uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; }
UniqueKeyDescFactoryImpl implements UniqueKeyDescFactory { public UniqueKeyDesc getSingleUniqueKeyDesc(ColumnDesc columnDesc) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); if (columnDesc.isUnique()) { String columnName = columnDesc.getName(); uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; } }
UniqueKeyDescFactoryImpl implements UniqueKeyDescFactory { public UniqueKeyDesc getSingleUniqueKeyDesc(ColumnDesc columnDesc) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); if (columnDesc.isUnique()) { String columnName = columnDesc.getName(); uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; } UniqueKeyDescFactoryImpl(GenDialect dialect); }
UniqueKeyDescFactoryImpl implements UniqueKeyDescFactory { public UniqueKeyDesc getSingleUniqueKeyDesc(ColumnDesc columnDesc) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); if (columnDesc.isUnique()) { String columnName = columnDesc.getName(); 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 getSingleUniqueKeyDesc(ColumnDesc columnDesc) { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); if (columnDesc.isUnique()) { String columnName = columnDesc.getName(); uniqueKeyDesc.addColumnName(columnName); } if (uniqueKeyDesc.getColumnNameList().isEmpty()) { return null; } return uniqueKeyDesc; } UniqueKeyDescFactoryImpl(GenDialect dialect); UniqueKeyDesc getCompositeUniqueKeyDesc(
            UniqueConstraint uniqueConstraint); UniqueKeyDesc getSingleUniqueKeyDesc(ColumnDesc columnDesc);  }