-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HBX-2754: Create Interface for JoinWrapper
- Create new initial test class 'org.hibernate.tool.orm.jbt.api.JoinWrapperTest' - Create new initial interface class 'org.hibernate.tool.orm.jbt.api.JoinWrapper' - Create new factory class 'org.hibernate.tool.orm.jbt.internal.factory.JoinWrapperFactory' Signed-off-by: Koen Aers <koen.aers@gmail.com>
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
jbt/src/main/java/org/hibernate/tool/orm/jbt/api/JoinWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.hibernate.tool.orm.jbt.api; | ||
|
||
import org.hibernate.tool.orm.jbt.wrp.Wrapper; | ||
|
||
public interface JoinWrapper extends Wrapper { | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
jbt/src/main/java/org/hibernate/tool/orm/jbt/internal/factory/JoinWrapperFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.hibernate.tool.orm.jbt.internal.factory; | ||
|
||
import org.hibernate.mapping.Join; | ||
import org.hibernate.tool.orm.jbt.api.JoinWrapper; | ||
|
||
public class JoinWrapperFactory { | ||
|
||
public static JoinWrapper createJoinWrapper(Join wrappedJoin) { | ||
return new JoinWrapper() { | ||
@Override public Join getWrappedObject() { return wrappedJoin; } | ||
}; | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
jbt/src/test/java/org/hibernate/tool/orm/jbt/api/JoinWrapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.hibernate.tool.orm.jbt.api; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.hibernate.mapping.Join; | ||
import org.hibernate.tool.orm.jbt.internal.factory.JoinWrapperFactory; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class JoinWrapperTest { | ||
|
||
private JoinWrapper joinWrapper = null; | ||
private Join wrappedJoin = null; | ||
|
||
@BeforeEach | ||
public void beforeEach() { | ||
wrappedJoin = new Join(); | ||
joinWrapper = JoinWrapperFactory.createJoinWrapper(wrappedJoin); | ||
} | ||
|
||
@Test | ||
public void testConstruction() { | ||
assertNotNull(wrappedJoin); | ||
assertNotNull(joinWrapper); | ||
} | ||
|
||
} |