Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. ServerRuntime cayenneRuntime = new ServerRuntime("cayenne-BlueTwine.xml");
  2. ObjectContext context = cayenneRuntime.getContext();
  3.  
  4. Project project = context.newObject(Project.class); // Add new project to context
  5.  
  6. // set some variables on project object
  7.  
  8. Div rootDiv = context.newObject(Div.class);
  9.  
  10. // set some variables on rootDiv object
  11.  
  12. rootDiv.setProject(project);
  13.  
  14. context.commitChanges();
  15.  
  16. System.out.println(rootDiv.getProject().getId()); // Returns null pointer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement