喂...
我有一些课程:
1.扩展到值
的TermValue
public class TermValue extends Value<String> {
public static String CONTENT_ATTR = "content";
private static final long serialVersionUID = 1L;
protected static final String ID_EDEFAULT = null;
:
:
}
<代码>2。值
public abstract class Value<T> implements Serializable {
public static String VALUE_ATTR = "value";
public static String DISPLAY_VALUE_ATTR = "displayValue";
public static String DISPLAY_NAME_ATTR = "displayName";
:
:
}
3.备选案文
public class Option implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
protected List<Value<?>> values;
:
:
}
java.lang.InstantiationError: id.co.bippo.commerce.share.Value
at id.co.bippo.commerce.share.Value_Instantiator_kj58jw.newInstance(Unknown Source)
at org.springframework.data.convert.ClassGeneratingEntityInstantiator$EntityInstantiatorAdapter.createInstance(ClassGeneratingEntityInstantiator.java:224)
at org.springframework.data.convert.ClassGeneratingEntityInstantiator.createInstance(ClassGeneratingEntityInstantiator.java:86)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:273)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:253)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readCollectionOrArray(MappingMongoConverter.java:978)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readValue(MappingMongoConverter.java:1386)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:1335)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readProperties(MappingMongoConverter.java:335)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:297)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:253)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readCollectionOrArray(MappingMongoConverter.java:978)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readValue(MappingMongoConverter.java:1386)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:1335)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readProperties(MappingMongoConverter.java:335)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:297)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:253)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readCollectionOrArray(MappingMongoConverter.java:978)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readValue(MappingMongoConverter.java:1386)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:1335)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readProperties(MappingMongoConverter.java:335)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:297)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:253)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:202)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:198)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:86)
at org.springframework.data.mongodb.core.MongoTemplate$ReadDocumentCallback.doWith(MongoTemplate.java:2785)
at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:2401)
at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:2193)
at org.springframework.data.mongodb.core.MongoTemplate.findOne(MongoTemplate.java:716)
at org.springframework.data.mongodb.core.MongoTemplate.findOne(MongoTemplate.java:704)
at id.co.bippo.commerce.mongo.MongoConnectionTest.show_simplified_product_variant(MongoConnectionTest.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
我如何解决(或替代)这些问题?
尝试通过java代码保存数据,那么您就不会面临这个问题了。
它们是一个fieldclass,数据库中需要它来将它映射到正确的实现中。值为类名(如下所示)的class字段是在您输入数据抛出java时自动创建的,但在手动输入数据时,我们没有添加它,这会导致实例化错误。
我的lms类(抽象类)也面临这个问题,LTIConfiguration类正在实现lms。
具有_class的Mongo db结构:
{
"providers" : {
"lti" : {
"integrationConfiguration" : {
"launchUrl" : "",
"key" : "",
"secret" : "",
"_class" : "com.projectName.common.model.configuration.LTIConfiguration"
}
}
}
}
“绑定不匹配:Team类型不是league类型 的有界参数 >的有效替代品。”
问题内容: 我有一个像这样的课程: 但是编译器说:。 我如何获得的课程? 问题答案: 绝对有可能将其提取出来,因为它不是在运行时定义的,而是在编译时由定义的。 这是一个启动示例,您可以如何在抽象类的构造函数中提取所需的泛型超类型,同时考虑子类的层次结构(以及在无需显式提供类型的情况下将其应用于泛型方法的实际用例)):
我有这样的抽象类: 我还有一个扩展抽象的类:
它是关于java中具有两种泛型类型(一种用于返回类型,另一种用于形式参数)的泛型方法以及如何实现它。我想我在图片中缺少一些东西来让它工作。 事情是这样的... 这是工作 : 这不起作用: java编译器告诉我: 好吧,就是这样。提前感谢大家!希望它能在未来帮助别人! P、 D:这不是枚举类型的问题。它发生在类和层次结构之间。所以别怪Enum了,我试过了,但没用。 对于泛型参数 我们可以做一个一般规
例如,我有以下接口 实现此接口的抽象类 以及具体实施 我想建议所有将转换为任何内容的方法。我创建了以下方面 这是行不通的。Spring不会为类创建代理。然而,如果我从抽象类重写方法,它将开始工作,Spring成功地为创建代理,并执行所有需要的逻辑。 为什么会发生这种情况?有没有办法定义切入点,这样我就不需要重写方法?
现在,当我在地图上迭代时…我能以某种方式获得每个Class1对象的类型(K,V)吗??