Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteNode.fromJson, ReadNode.toBean #5

Open
bleujin opened this issue Apr 26, 2013 · 4 comments
Open

WriteNode.fromJson, ReadNode.toBean #5

bleujin opened this issue Apr 26, 2013 · 4 comments
Assignees

Comments

@bleujin
Copy link
Owner

bleujin commented Apr 26, 2013

WriteNode.fromBean, ReadNode.toBean,

@ghost ghost assigned bleujin Apr 28, 2013
@bleujin
Copy link
Owner Author

bleujin commented Apr 29, 2013

Proxy ?

  • javassist, asm, invocationHandler ?

@bleujin
Copy link
Owner Author

bleujin commented May 21, 2013

WriteNode.fromJson 인건..
ref 해석이 사실상 불가능하기 때문..( annotation을 붙인다면 가능..)

Json안의 Json은 모두 Child로 해석한다.

@bleujin
Copy link
Owner Author

bleujin commented May 21, 2013

toBean은 대충 이렇게....

public void testWhenHasChild() throws Exception {
    session.tran(new TransactionJob<Void>() {
        @Override
        public Void handle(WriteSession wsession) {
            wsession.pathBy("/dept/dev").property("deptno", 20).property("name", "dev")
                .addChild("manager").property("name", "bleujin").property("age", 20).parent() 
                .addChild("address").property("city", "seoul").property("bun", 0) ;
            return null;
        }
    }).get() ;


    Dept dept = session.pathBy("/dept/dev").toBean(Dept.class) ;
    assertEquals(20, dept.deptNo()) ;
    assertEquals("dev", dept.name()) ;
    assertEquals("bleujin", dept.manager().name()) ;
    assertEquals(20, dept.manager().age()) ;

    assertEquals("seoul", dept.address().city()) ;
    assertEquals(0, dept.address().bun()) ;
}

@bleujin
Copy link
Owner Author

bleujin commented May 21, 2013

toBean은 CGILib를 사용한 Proxy Pattern을 사용하고 있다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant