私は、snakeyaml (Java) ベースのパーサーを使用してテスト ケースを作成しましたが、グラフを適切に作成する方法がわかりませんでした。どんな助けでも大歓迎です。ありがとう。
RuntimeException occured : Cannot load fixture test-data.yml:
org.hibernate.PropertyAccessException: could not get a field value by
reflection getter of models.Priority.description
上記の例外は無関係なフィールドに対するものであり、関連付けを削除すると機能します
roles:
- roleType: testRoleType
description: desc
に変更すると
- !models.Role
roleType: testRoleType
description: desc
RuntimeException が発生しました: フィクスチャ test-data.yml を読み込めません: null; !models.Role; の Java オブジェクトを構築できません。exception=onRole 任意のヘルプ、高く評価します。ありがとう。
public class Person {
String fullname;
@OneToMany(cascade=CascadeType.ALL)
public List<Role> roles;
}
public class Role {
public RoleType roleType;
public String description;
}
public class RoleType {
public String roleName;
public String description;
}
YAML--
RoleType (testRoleType):
roleName: test
description: desc
Person(administrator):
fullname: Administrator
roles:
- roleType: testRoleType
description: desc