次のクラス階層があります。
class Incident {// Id => Entity
@Id
String id
List<Participant> participants
List<RealEstateProperty> realEstateProperties
}
どこ
class Participant {// No id => by javers terms - ValueObject
EnclosedContact contact
}
class EnclosedContact {// No id => by javers terms - ValueObject
String name
}
class RealEstateProperty {// No id => by javers terms - ValueObject
List<CadastralSection> cadastralSections
}
class CadastralSection {// No id => by javers terms - ValueObject
String sectionId
}
次のテストを(groovyで)作成しました:
def "Querying Javers Repository for participants changes works correctly"() {
given:
(1..3).each {
javers.commit("author", new Incident(
id: it,
participants: [
new Participant(contact: new EnclosedContact(id: 20 + it))
]
))
}
when:
def snapshots = javers.findSnapshots(QueryBuilder.byValueObjectId(1, Incident.class, "contact").build())
then:
assert snapshots.size() == 1
}
このテストの結果は次のとおりです。
JaversException: PROPERTY_NOT_FOUND property 'contact' not found in class 'Incident'
この方法で変更を取得しようとしています
def snapshots = javers.findSnapshots(QueryBuilder.byValueObjectId(1, Incident.class, "participants/0/contact").build())
空のリストを返します。
Javars はネストされた ValueObject の変更の選択をサポートしていますか?