use @idview field in spec dto cause NullPointerException
Exception
java.lang.NullPointerException: Cannot invoke "org.babyfish.jimmer.meta.ImmutableType.getJavaClass()" because "type" is null
at org.babyfish.jimmer.sql.ast.impl.table.TableProxies.createConstructor(TableProxies.java:115)
at org.babyfish.jimmer.sql.ast.impl.table.TableProxies.createFluentConstructor(TableProxies.java:67)
at org.babyfish.jimmer.impl.util.TypeCache.get(TypeCache.java:80)
at org.babyfish.jimmer.sql.ast.impl.table.TableProxies.fluent(TableProxies.java:52)
at org.babyfish.jimmer.sql.ast.table.spi.AbstractTypedTable.join(AbstractTypedTable.java:275)
at org.babyfish.jimmer.sql.ast.table.spi.AbstractTypedTable.getAssociatedId(AbstractTypedTable.java:196)
at org.babyfish.jimmer.sql.ast.table.spi.AbstractTypedTable.get(AbstractTypedTable.java:166)
at org.babyfish.jimmer.sql.ast.query.specification.PredicateApplier.eq(PredicateApplier.java:63)
at io.qifan.mall.server.coupon.user.entity.dto.CouponUserSpec.applyTo(CouponUserSpec.java:159)
at org.babyfish.jimmer.sql.ast.impl.query.MutableRootQueryImpl.where(MutableRootQueryImpl.java:229)
at io.qifan.mall.server.coupon.user.repository.CouponUserRepository.findPage(CouponUserRepository.java:31)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:249)
at jdk.proxy2/jdk.proxy2.$Proxy132.findPage(Unknown Source)
at io.qifan.mall.server.coupon.user.service.CouponUserService.query(CouponUserService.java:43)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
Code
Entity
@Entity
@GenEntity
@Table(name = "coupon_user_rel")
public interface CouponUser extends BaseEntity {
// ...
@GenField(value = "拥有者", order = 2)
@ManyToOne
User user();
@IdView
String userId();
// ...
}
use @idview field in spec dto cause NullPointerException
Exception
Code
Entity
Spec Dto
QueryMethod