当我尝试使用 UUID 字段映射类时出现以下异常。日期类型的字段也是如此。我的实体需要具有这些值的字段,有什么可能的解决方案?
java.lang.RuntimeException: Failure scanning class(see chained exception)=class com.s1mbi0se.dmp.da.bean.User
at com.alvazan.orm.layer0.base.MyClassAnnotationDiscoveryListener.scanClass(MyClassAnnotationDiscoveryListener.java:44)
at com.alvazan.orm.layer0.base.BaseEntityManagerFactoryImpl.rescan(BaseEntityManagerFactoryImpl.java:83)
at com.alvazan.orm.layer0.base.BaseEntityManagerFactoryImpl.setup(BaseEntityManagerFactoryImpl.java:131)
at com.alvazan.orm.impl.bindings.BootstrapImpl.createInstance(BootstrapImpl.java:51)
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:53)
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:48)
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:45)
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:41)
at com.s1mbi0se.dmp.da.dao.PlayOrmConfiguration.init(PlayOrmConfiguration.java:39)
at com.s1mbi0se.dmp.da.dao.TestUserDao.testUserOperations(TestUserDao.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: Failure scanning field=private java.util.Date com.s1mbi0se.dmp.da.bean.User.birthDate for class=User
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectField(ScannerForClass.java:179)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.scanFields(ScannerForClass.java:172)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.scanSingle(ScannerForClass.java:111)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.addClass(ScannerForClass.java:67)
at com.alvazan.orm.layer0.base.MyClassAnnotationDiscoveryListener.scanClass(MyClassAnnotationDiscoveryListener.java:42)
... 32 more
Caused by: java.lang.IllegalArgumentException: No converter found for field='birthDate' in class=class com.s1mbi0se.dmp.da.bean.User. You need to either add one of the @*ToOne annotations, @Embedded, @Transient or add your own converter calling EntityMgrFactory.setup(Map<Class, Converter>) which will then work for all fields of that type OR add @Column(customConverter=YourConverter.class) or finally if we missed a standard converter, we need to add it in file InspectorField.java in the constructor and it is trivial code(and we can copy the existing pattern)
at com.alvazan.orm.impl.meta.scan.ScannerForField.processColumn(ScannerForField.java:173)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectFieldImpl(ScannerForClass.java:205)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectField(ScannerForClass.java:177)
... 36 more