Skip to content

Commit

Permalink
HBX-2754: Create Interface for JoinWrapper
Browse files Browse the repository at this point in the history
  - 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
koentsje committed Mar 19, 2024
1 parent ed3e5b0 commit 84e7ad8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
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 {

}
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; }
};
}

}
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);
}

}

0 comments on commit 84e7ad8

Please sign in to comment.