2
Objectify (2.2.3)는 @ 포함 된 문자열 목록을 처리하지 않으려는 것 같지만 모든 문서에서 가능해야한다고 말합니다. 문자열은 변환해야하는 사용자 정의 객체 인 것처럼 처리됩니다. 최소 예 :Objectify가 문자열의 @ 포함 목록을 저장하지 못함
이 클래스의 인스턴스로 저장됩니다public class Test {
@Id public Long id = null;
@Embedded private List<String> strings = new ArrayList<String>();
private Test() {}
public Test(String[] in) {
for (String s : in) {
strings.add(s);
}
}
: 문자열을 해시로 저장됩니다
가Key: 7
ID/Name: ahpzY2hlZHVsZS13aXRoLXlvdXItZnJpZW5kc3IKCxIEVGVzdBgHDA
strings.hash: [0, 0]
주의, 그것은 문자열에서 유일한 비 최종 필드 인
이 코드는 실패합니다
ObjectifyService.register(Test.class);
Test t = new Test(new String[] { "aa", "bb" });
Objectify ofy = ObjectifyService.begin();
ofy.put(t);
Test t2 = ofy.get(Test.class, t.id); //<-- fails with IllegalAccessException: Private fields can not be set on JRE classes.
내가 잘못 여기서 뭔가를하고 있습니까? 내장 된 문자열 목록이 지원되지 않습니까?