Skip to content

Commit

Permalink
HBX-2747: Create Interface for ForeignKeyWrapper
Browse files Browse the repository at this point in the history
  - Add new test case 'org.hibernate.tool.orm.jbt.api.ForeignKeyWrapperTest#testContainsColumn()'
  - Add new default interface method 'org.hibernate.tool.orm.jbt.api.ForeignKeyWrapper#containsColumn(Column)'

Signed-off-by: Koen Aers <koen.aers@gmail.com>
  • Loading branch information
koentsje committed Mar 13, 2024
1 parent 589a5bd commit 10431fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public interface ForeignKeyWrapper extends Wrapper {

default List<Column> getReferencedColumns() { return ((ForeignKey)getWrappedObject()).getReferencedColumns(); }

default boolean containsColumn(Column column) { return ((ForeignKey)getWrappedObject()).containsColumn(column); }

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,12 @@ public void testGetReferencedColumns() {
assertSame(column, list.get(0));
}

@Test
public void testContainsColumn() throws Exception {
Column column = new Column("foo");
assertFalse(foreignKeyWrapper.containsColumn(column));
wrappedForeignKey.addColumn(column);
assertTrue(foreignKeyWrapper.containsColumn(column));
}

}

0 comments on commit 10431fc

Please sign in to comment.