2
NodeEntity:春データのNeo4jカスタムクエリリストは、コンバータを使用しないのparams
@NodeEntity(label = "User")
public class UserNode {
@GraphId
private Long _gid;
@Index(unique = true, primary = true)
@Convert(ObjectIdConverter.class)
private ObjectId id;
}
コンバータ:
public class ObjectIdConverter implements AttributeConverter<ObjectId, String>{
@Override
public String toGraphProperty(ObjectId value) {
return ObjectIdUtils.compressed(value);
}
@Override
public ObjectId toEntityAttribute(String value) {
return ObjectIdUtils.uncompress(value);
}
}
リポジトリ:
public interface UserNodeRepository extends GraphRepository<UserNode> {
@Query("MATCH (user:User) WHERE user.id IN {0} RETURN user")
List<UserNode> findByIdIn(List<ObjectId> ids);
}
UserNodeRepository#findByIdInは、カスタムクエリです。要求パラメータは直接に変換され、ObjectIdConverterを使用せずににjsonに変換されます。
ログイン:
o.n.o.drivers.bolt.request.BoltRequest : Request: MATCH (user:User) WHERE user.id IN {0} RETURN user with params {0=[{timestamp=1500442853, machineIdentifier=11302907, processIdentifier=11906, counter=4709865, time=1500442853000, date=1500442853000, timeSecond=1500442853}, {timestamp=1500445335, machineIdentifier=11302907, processIdentifier=11906, counter=4709946, time=1500445335000, date=1500445335000, timeSecond=1500445335}, {timestamp=1500447522, machineIdentifier=11302907, processIdentifier=11906, counter=4710014, time=1500447522000, date=1500447522000, timeSecond=1500447522}, {timestamp=1500448399, machineIdentifier=11302907, processIdentifier=11906, counter=4710092, time=1500448399000, date=1500448399000, timeSecond=1500448399}]}
が、これはSDNの期待ですか、私は何のコンセプトを失っていますか?
リストと同じバグです。 –
Alex