실험실2010. 8. 19. 13:43
부모의 부분

@Persistent
private Set<UsersProblemInfo>  userProblemInfo = new HashSet<UsersProblemInfo>();


자식 부분
@Persistent
    @Extension(vendorName="datanucleus", key="gae.parent-pk", value="true")
    private Key userKey;


로직

upi = new UsersProblemInfo();
...
upi.setUserKey(user.getKey());

이후 받아올때


System.out.println("user ProblemInfo Size = "+ user.getUserProblemInfo().size()); 
에서 적용이 된것을 알 수 있었다.


결론 
추가 된다.






Posted by 작업하는 을지랑
TAG GAE

댓글을 달아 주세요

카테고리 없음2010. 8. 4. 17:19

public class test {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

System.out.println(""+getA());

System.out.println(""+getA());

System.out.println(""+getA());
}
public static int getA(){
final int a= get();
return a;
}
static int a;
public static int get()
{
return ++a;
}

}


결과는 1, 2,,3 으로나온다.
단지 초기화된 후 고정되는것일 뿐인듯하다.
클래스안의 변수를 많이 줄일 수 있을듯.

Posted by 작업하는 을지랑

댓글을 달아 주세요