gpt4 book ai didi

playframework - 绑定(bind)到 SnakeYAML/Play 框架中的内部类

转载 作者:行者123 更新时间:2023-12-04 06:38:18 25 4
gpt4 key购买 nike

我有一个这样的模型:

package models;

@Entity
public class Order extends Model
{
@Entity
public static class Line extends Model
{
}
}

如何为 Order.Line 加载夹具?正常方式不起作用:
Order.Line(OrderLine_1): 
.......

原因:
RuntimeException occured : Class models.Order.Line was not found 
play.exceptions.JavaExecutionException: Class models.Order.Line was
not found
at play.jobs.Job.call(Job.java:127)
at Invocation.Job(Play!)
Caused by: java.lang.RuntimeException: Class models.Order.Line was not
found
at play.test.Fixtures.load(Fixtures.java:224)
at com.site.jobs.Bootstrap.doJob(Bootstrap.java:47)
at play.jobs.Job.doJobWithResult(Job.java:45)
at play.jobs.Job.call(Job.java:118)
... 1 more
Caused by: java.lang.ClassNotFoundException: models.Order.Line
at java.lang.ClassLoader.findClass(ClassLoader.java:359)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at
play.classloading.ApplicationClassloader.loadClass(ApplicationClassloader.j ava:
84)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at play.test.Fixtures.load(Fixtures.java:200)
... 4 more

最佳答案

在 YML 文件中,使用 Order$Line而不是 Order.Line :

Order$Line(OrderLine_1):
....

关于playframework - 绑定(bind)到 SnakeYAML/Play 框架中的内部类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4598590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com