[google-appengine] Re: onowned Many2Many relationship management - how to handle
Hi, Can you be little more elaborative? Do you mean that i should create another entity to store the relationship details from Tour-User and User-Tour? regards, Siddharth On Jan 19, 11:06 am, OvermindDL1 overmind...@gmail.com wrote: On Mon, Jan 18, 2010 at 10:49 PM, Siddharth Patnaik spatnai...@gmail.com wrote: Hi Guys, This is an urgent issue for me. Can anyone of you please respond to this question? If the question is not clear or more info is required please let me know On Jan 17, 7:07 pm, Siddharth Patnaik spatnai...@gmail.com wrote: Hi, I have the following situation. I have 2 entities User and Tour and i wanted to have unowned relationship between these two. I have followed the the relationships article on GAE documentation. I am taking care of relationships at both the ends. However my problem is that only one side of the relationship is getting persisted. Here is my sample code: create a persistence manager, pm start transaction create Tour object set the values for this object add a user object //as part of this i am also adding the tour object to the user object pm.makePersistent(tour); commit the transaction My problem is, the user object is never getting updated (with tour relationship info) How do i achieve this? Why not just do ManyToMany like in a normal relational database. Make a link table that contains indexed id's to each of the others that are linked? -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: onowned Many2Many relationship management - how to handle
Hi, I know how to do this in a RDBMS. If i were using a OR mapping framework like hibernate i would have followed your apporach. However in GAE we are not doing OR mapping at all. In java class annotations we are not at all talking about Tables/columns etc etc. is n't it? We just know about the objects/properties and relationship. In the example we just know 2 objects User and Tour. I do not think we should create a third object called Tour_User_Link and take care of persistance/relationship management and querying ourselves. Do you agree? or Am i missing something? regards, Siddharth On Jan 19, 2:06 pm, OvermindDL1 overmind...@gmail.com wrote: On Tue, Jan 19, 2010 at 1:32 AM, Siddharth Patnaik spatnai...@gmail.com wrote: Hi, Can you be little more elaborative? Do you mean that i should create another entity to store the relationship details from Tour-User and User-Tour? Just as you might do it with SQL actually, here, some pseudo-code: Table Tour; // definition snipped Table User; // definition snipped Table Tour_User_Link { int tour_id; // indexed int user_id; // indexed } And anytime you create a many-to-many link you just create a new row in Tour_User_Link with the id's set to the appropriate table id's. Nothing special about it, this is how many-to-many is implemented in any database system that I have ever seen so far... How else could you do it. What were you trying to do? -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: onowned Many2Many relationship management - how to handle
This is GAE mailing list. Actually i am looking for a way how to achieve Many to many relationships in GAE. Thats the reason i have posted my question here On Jan 19, 4:21 pm, OvermindDL1 overmind...@gmail.com wrote: On Tue, Jan 19, 2010 at 3:37 AM, Siddharth Patnaik spatnai...@gmail.com wrote: Hi, I know how to do this in a RDBMS. If i were using a OR mapping framework like hibernate i would have followed your apporach. However in GAE we are not doing OR mapping at all. In java class annotations we are not at all talking about Tables/columns etc etc. is n't it? We just know about the objects/properties and relationship. In the example we just know 2 objects User and Tour. I do not think we should create a third object called Tour_User_Link and take care of persistance/relationship management and querying ourselves. Do you agree? or Am i missing something? Well as this is not the AppEngine Java mailing list (if you are asking how to do this in Java, you should go there), I can not say, this is the generic AppEngine mailing list, as such I can tell you how it is done in the back-end, not Java, and in every RDBMS and ORM I have seen them do link tables behind the scenes as well. Even in a flat table system like GAE you still need a link table. -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: onowned Many2Many relationship management - how to handle
Hi Guys, This is an urgent issue for me. Can anyone of you please respond to this question? If the question is not clear or more info is required please let me know regards, Siddharth On Jan 17, 7:07 pm, Siddharth Patnaik spatnai...@gmail.com wrote: Hi, I have the following situation. I have 2 entities User and Tour and i wanted to have unowned relationship between these two. I have followed the the relationships article on GAE documentation. I am taking care of relationships at both the ends. However my problem is that only one side of the relationship is getting persisted. Here is my sample code: create a persistence manager, pm start transaction create Tour object set the values for this object add a user object //as part of this i am also adding the tour object to the user object pm.makePersistent(tour); commit the transaction My problem is, the user object is never getting updated (with tour relationship info) How do i achieve this? -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] onowned Many2Many relationship management - how to handle
Hi, I have the following situation. I have 2 entities User and Tour and i wanted to have unowned relationship between these two. I have followed the the relationships article on GAE documentation. I am taking care of relationships at both the ends. However my problem is that only one side of the relationship is getting persisted. Here is my sample code: create a persistence manager, pm start transaction create Tour object set the values for this object add a user object //as part of this i am also adding the tour object to the user object pm.makePersistent(tour); commit the transaction My problem is, the user object is never getting updated (with tour relationship info) How do i achieve this? -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: How can i run my persistance test cases in a standalone mode?
thanks. I created a separate test project to be in the safer side. regards, Siddharth On Jan 15, 11:39 pm, Ikai L (Google) ika...@google.com wrote: Have you taken a look at this page in the docs? http://code.google.com/appengine/docs/java/howto/unittesting.html It shows you how to set up a standalone environment for JUnit. It looks like you're writing your tests using a custom Testing class, but the same principles should apply. On Fri, Jan 15, 2010 at 12:06 AM, Siddharth Patnaik spatnai...@gmail.comwrote: I would like to run my test cases (CRUD operations on my business objects) in a stand alone manner. When i am performing any CRUD operation in a stand alone way i am getting the following exception. It is clear that the persistence handler needs a context. How can i provide that? INFO: Finished performing appengine-specific metadata validation for com.tripgether.persistance.bo.User java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId (DatastoreApiHelper.java:67) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamesp ace (DatastoreApiHelper.java:77) at com.google.appengine.api.datastore.Key.init(Key.java:100) at com.google.appengine.api.datastore.Key.init(Key.java:85) at com.google.appengine.api.datastore.Key.init(Key.java:81) at com.google.appengine.api.datastore.Entity.init(Entity.java:103) at com.google.appengine.api.datastore.Entity.init(Entity.java:84) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:167) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProces s (DatastorePersistenceHandler.java:316) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects (DatastorePersistenceHandler.java:236) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject (DatastorePersistenceHandler.java:225) at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent (JDOStateManagerImpl.java:3185) at org.datanucleus.state.JDOStateManagerImpl.makePersistent (JDOStateManagerImpl.java:3161) at org.datanucleus.ObjectManagerImpl.persistObjectInternal (ObjectManagerImpl.java:1298) at org.datanucleus.ObjectManagerImpl.persistObject (ObjectManagerImpl.java:1175) at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent (JDOPersistenceManager.java:669) at org.datanucleus.jdo.JDOPersistenceManager.makePersistent (JDOPersistenceManager.java:694) at com.tripgether.persistance.TestCRUD.main(TestCRUD.java:27) -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2Bunsubscrib e...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en. -- Ikai Lan Developer Programs Engineer, Google App Engine -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: How can i view my application data?
thank you. regards, Siddharth On Jan 14, 6:41 pm, Adam adam.crossl...@gmail.com wrote: You can use the Development Console (http://code.google.com/appengine/ docs/python/tools/devserver.html#The_Development_Console), It has a tool for looking into the Datastore. On Jan 14, 8:35 am,Siddharthspatnai...@gmail.com wrote: Persistence management provided by GAE is great. However i am facing some practical issues wrt this. 1. In my development environment, I would like to view the application data. There are many reasons one of them being for debugging. Is there any viewer for my application data? 2. Similarly i would like to view my application data after deploying my application on GAE. How do i do it ? -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] How can i run my persistance test cases in a standalone mode?
I would like to run my test cases (CRUD operations on my business objects) in a stand alone manner. When i am performing any CRUD operation in a stand alone way i am getting the following exception. It is clear that the persistence handler needs a context. How can i provide that? INFO: Finished performing appengine-specific metadata validation for com.tripgether.persistance.bo.User java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId (DatastoreApiHelper.java:67) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace (DatastoreApiHelper.java:77) at com.google.appengine.api.datastore.Key.init(Key.java:100) at com.google.appengine.api.datastore.Key.init(Key.java:85) at com.google.appengine.api.datastore.Key.init(Key.java:81) at com.google.appengine.api.datastore.Entity.init(Entity.java:103) at com.google.appengine.api.datastore.Entity.init(Entity.java:84) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:167) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess (DatastorePersistenceHandler.java:316) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects (DatastorePersistenceHandler.java:236) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject (DatastorePersistenceHandler.java:225) at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent (JDOStateManagerImpl.java:3185) at org.datanucleus.state.JDOStateManagerImpl.makePersistent (JDOStateManagerImpl.java:3161) at org.datanucleus.ObjectManagerImpl.persistObjectInternal (ObjectManagerImpl.java:1298) at org.datanucleus.ObjectManagerImpl.persistObject (ObjectManagerImpl.java:1175) at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent (JDOPersistenceManager.java:669) at org.datanucleus.jdo.JDOPersistenceManager.makePersistent (JDOPersistenceManager.java:694) at com.tripgether.persistance.TestCRUD.main(TestCRUD.java:27) -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.