Skip to content

Commit 6e76fa0

Browse files
authored
Merge pull request #289 from hazendaz/master
Type bean as an object and update comments on aquillian usage
2 parents 9967a7d + 53e3c98 commit 6e76fa0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Testing with Arquillian
4949

5050
In order to test with Arquillian, one class needs to be added to 'JavaArchive' in order for this to load properly. Add 'SqlSessionManagerRegistry.class'.
5151

52-
See attachment on https://github.com/mybatis/cdi/issues/86 from 2021-12-30 ArqullianMybatisExample.zip [here](https://github.com/mybatis/cdi/files/7795050/ArquillianMybatisExample.zip)
52+
See attachment on https://github.com/mybatis/cdi/issues/86 from 2021-12-30 ArquillianMybatisExample.zip [here](https://github.com/mybatis/cdi/files/7795050/ArquillianMybatisExample.zip). This is to be run under jdk 8 to be error free but will run as-is under jdk 11 with an invocation error which still allows it to run. Further updates are needed to get this code example current.
5353

5454
Essentials
5555
----------

src/main/java/org/mybatis/cdi/MyBatisBean.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*
4040
* @author Frank D. Martinez [mnesarco]
4141
*/
42-
public class MyBatisBean implements Bean, Serializable, PassivationCapable {
42+
public class MyBatisBean implements Bean<Object>, Serializable, PassivationCapable {
4343

4444
private static final long serialVersionUID = 1L;
4545

@@ -124,17 +124,17 @@ public Set<InjectionPoint> getInjectionPoints() {
124124
}
125125

126126
@Override
127-
public Object create(CreationalContext creationalContext) {
127+
public Object create(CreationalContext<Object> creationalContext) {
128128
if (SqlSession.class.equals(this.type)) {
129129
return findSqlSessionManager(creationalContext);
130130
}
131131
ErrorContext.instance().reset();
132132
return Proxy.newProxyInstance(SqlSessionFactory.class.getClassLoader(), new Class[] { this.type },
133-
new SerializableMapperProxy(this, creationalContext));
133+
new SerializableMapperProxy<Object>(this, creationalContext));
134134
}
135135

136136
@Override
137-
public void destroy(Object instance, CreationalContext creationalContext) {
137+
public void destroy(Object instance, CreationalContext<Object> creationalContext) {
138138
creationalContext.release();
139139
}
140140

src/test/java/org/mybatis/cdi/MybatisExtensionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void mappersFoundAfterTheBeanUsingTheMapperInAnInjectionPointHasBeenScannedShoul
5353
AfterBeanDiscovery afterBeanDiscovery = mock(AfterBeanDiscovery.class);
5454
extension.afterBeanDiscovery(afterBeanDiscovery);
5555

56-
verify(afterBeanDiscovery).addBean((Bean<?>) any());
56+
verify(afterBeanDiscovery).addBean((Bean<Object>) any());
5757

5858
}
5959

0 commit comments

Comments
 (0)