Re: [appengine-java] gmail contacts
u can use gdata to get ur gmail contacts and to send message you can use javamail. Below is code to get your contacts from gmail import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.google.gdata.client.Query; import com.google.gdata.client.contacts.ContactsService; import com.google.gdata.data.contacts.ContactEntry; import com.google.gdata.data.contacts.ContactFeed; import com.google.gdata.data.extensions.Email; import com.google.gdata.util.AuthenticationException; import com.google.gdata.util.ServiceException; public class GmailContacts { public static ListContact getConatacts(String email, String password) throws IOException, ServiceException { ContactsService service = new ContactsService( Google-contactsExampleApp-3); service.setUserCredentials(email, password); URL url = new URL( http://www.google.com/m8/feeds/contacts/+email+/thin;); Query myQuery = new Query(url); myQuery.setMaxResults(1000); ContactFeed resultFeed = service.query(myQuery, ContactFeed.class); ListContact contactList = new ArrayListContact(); for (ContactEntry entry : resultFeed.getEntries()) { ListEmail emailList = entry.getEmailAddresses(); for (Iterator iterator = emailList.iterator(); iterator.hasNext();) { Email emailObj = (Email) iterator.next(); contactList.add(new Contact(emailObj.getAddress(), entry .getTitle().getPlainText() == null ? : entry .getTitle().getPlainText())); // String name = entry.getName()!= // null?entry.getName().toString():; // System.out.println(entry.getTitle().getPlainText()+ +entry.getNickname()+ +entry.getShortName()+ +email.getDisplayName()+ +email.getAddress()); } } return contactList; } public static void main(String []args)throws IOException, ServiceException{ ListContact contList = getConatacts(email@gmail.com, password); for (Iterator iterator = contList.iterator(); iterator.hasNext();) { Contact contact = (Contact) iterator.next(); System.out.println(contact.getTitle()+ +contact.getEmail()); } } } public class Contact { private String email; private String title; public Contact(String email, String title) { super(); this.email = email; this.title = title; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } On Mon, Aug 2, 2010 at 4:05 PM, Ahmed Shoeib ahmedelsayed.sho...@gmail.comwrote: Hi All , i want to get my gmail contacts and able to send message to anyone of them how i can do that ??? thanks for advance, ahmed shoeib java developer -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: SQL Like operator with %
searchWords is list of strings. On Wed, Jul 7, 2010 at 4:38 AM, Julian! julia...@gmail.com wrote: Hi There searchWords is a List of User entity that contains All tokens? the filter in de JDOQL WHERE searchWords == \+tag.toUpperCase()+. find some token in all elements on the List property ??? Thanks !! On 2 jul, 06:49, RAVINDER MAAN rsmaan...@gmail.com wrote: we can set it in following way public class User { @Persistent(defaultFetchGroup=true) private SetString searchWords; public static void getCombination(String word,Set searchWords){ word = word.trim().toUpperCase(); if(word == null || .equals(word)) return ; int wordLength = word.length(); while(true){ for(int i=0;iwordLength - 2;i++){ searchWords.add(word.substring(i, wordLength));} for(int i=wordLength-1;i 1;i--){ searchWords.add(word.substring(0, i));} word = word.substring(1,wordLength-1); wordLength = word.length(); if(wordLength = 2) break; else searchWords.add(word);} return ; } public ListUser search(String tag){ PersistenceManager pm = PMF.getPM(); Transaction tx=pm.currentTransaction(); try { tx.begin(); Query q = pm.newQuery(javax.jdo.query.JDOQL,SELECT FROM +User.class.getName()+ WHERE searchWords == \+tag.toUpperCase()+\); q.setRange(0,10); ListUser c = (ListUser)q.execute(); tx.commit(); return c;} finally { if (tx.isActive()) { tx.rollback(); } pm.close();} } } You can modify getCombination the way you want. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Uploading App to GAE with JSP compile Error
Hello all I have jsp file which I am including in other jsp`s using include directive.I am declaring variables in the parent JSP .So included jsp has compilation errors because it is refering parent jsp`s variables.It is working fine on local .But when i try to upload application to GAE because of compilation errors it is not allowing me to upload the app.I know that by setting those variables at request scope i can solve this problem.I just want to know is there any way that i can upload app with jsp compilation errors? I have tried precompilation-enabledfalse/precompilation-enabled its not working. Thanks -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: SQL Like operator with %
You mean retrieve all entities and then use contains method? On Mon, Jul 5, 2010 at 8:29 AM, Khor Yong Hao fyh...@gmail.com wrote: Why not directly use String.contains(searchstring) method? -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: SQL Like operator with %
we can set it in following way public class User { @Persistent(defaultFetchGroup=true) private SetString searchWords; public static void getCombination(String word,Set searchWords){ word = word.trim().toUpperCase(); if(word == null || .equals(word)) return ; int wordLength = word.length(); while(true){ for(int i=0;iwordLength - 2;i++){ searchWords.add(word.substring(i, wordLength)); } for(int i=wordLength-1;i 1;i--){ searchWords.add(word.substring(0, i)); } word = word.substring(1,wordLength-1); wordLength = word.length(); if(wordLength = 2) break; else searchWords.add(word); } return ; } public ListUser search(String tag){ PersistenceManager pm = PMF.getPM(); Transaction tx=pm.currentTransaction(); try { tx.begin(); Query q = pm.newQuery(javax.jdo.query.JDOQL,SELECT FROM +User.class.getName()+ WHERE searchWords == \+tag.toUpperCase()+\); q.setRange(0,10); ListUser c = (ListUser)q.execute(); tx.commit(); return c; } finally { if (tx.isActive()) { tx.rollback(); } pm.close(); } } } You can modify getCombination the way you want. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Volunteers needed for magazine project
I would like to work with you.but i work in java .if you dont have any problem working in java then we can start . On Thu, Jul 1, 2010 at 9:43 PM, nosarious nosemon...@gmail.com wrote: Good morning, all. I am working on a magazine project that will hopefully use Google App Engine as the main way information is stored and retrieved. The goal is to be the Flickr of digital publishing. I have spent the past month trying to figure out the way to do this with Python, and haven't gotten as far as I would like. Due to the nature of this project (It's not intended to make me millions of dollars) and the altruistic goal (enabling anyone to publish content to e-devices like the iphone/ipad/mobile touch market/tablet computers/ multitouch surfaces, etc) without users being cobbled by a huge barrier to entry, I've decided to stop hoarding the idea and ask for volunteer programmers. I understand WHAT is needed to accomplish this, but I don't understand the HOW. I am more interested in publishing myself, but nothing exists in the format I envision. The engine can be run on java or python at this moment. It's a matter of which community responds first. If you would like more information, or to yell at me for assuming this part would be easy, you can reach me at: gerry.straathof AT acad.ca I have a general flow chart of how things should progress, but some parts are still labelled a miracle occurs... -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] name LIKE '%abc%'
Please check http://groups.google.com/group/google-appengine-java/browse_thread/thread/56720b03aa0d76fd/be4a5b327dd4051c?hl=enlnk=gstq=like#be4a5b327dd4051c -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Discussion for Best Practices For App Engine With Example
I have set up this project at http://code.google.com/p/forumdiscussion/ Please look at it and let me know if I need to change something. 2010/6/28 Andrés Cerezo acerezoguil...@gmail.com You can share source code with a svn from eclipse, look at http://www.youtube.com/watch?v=15jItreEX1M it's an installation and investigate about svn and google codes. 2010/6/28 RAVINDER MAAN rsmaan...@gmail.com I am sorry for long post .But i just want to know about other peoples view on this .In a way I just want to know what is the best way to implement this specification.May be it can be example project for other people . I am new to GAE so i dont know where to put its code and how to discuss it with other people.I am sorry for that can anyone suggest me the best way to discuss it with other people and how to share code ? Thanks . -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Discussion for Best Practices For App Engine With Example
Hi Jake Thanks .I was not aware about this project .I watched introductory video and It seems great.Thanks . On Tue, Jun 29, 2010 at 3:48 AM, Jake jbrooko...@cast.org wrote: Hey all, I've seen a lot of posts like this that are overwhelmed with getters/ setters. I wonder why more people haven't started to use lombok? http://projectlombok.org/ It is, by far, the best tool I've found when programming Java. I'm just wondering why it's not more commonly used. Jake On Jun 28, 5:02 pm, RAVINDER MAAN rsmaan...@gmail.com wrote: I have set up this project athttp://code.google.com/p/forumdiscussion/ Please look at it and let me know if I need to change something. 2010/6/28 Andrés Cerezo acerezoguil...@gmail.com You can share source code with a svn from eclipse, look at http://www.youtube.com/watch?v=15jItreEX1Mit'shttp://www.youtube.com/watch?v=15jItreEX1Mit%27san installation and investigate about svn and google codes. 2010/6/28 RAVINDER MAAN rsmaan...@gmail.com I am sorry for long post .But i just want to know about other peoples view on this .In a way I just want to know what is the best way to implement this specification.May be it can be example project for other people . I am new to GAE so i dont know where to put its code and how to discuss it with other people.I am sorry for that can anyone suggest me the best way to discuss it with other people and how to share code ? Thanks . -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Discussion for Best Practices For App Engine With Example
Hello all I am working on a project which has following requirements.Actually this is not real project .I am used to work with relational DB`s and for future projects I want to use GAE.Through this project I just want to learn best ways to use GAE . It is basically implementation of discussion groups(Same as forums on different sites).In the website users can discuss different topics with friends and other users of the website.So I have to implement following features. 1) User can have many friends. 2) Each user can create multiple discussions. 3) Each discussion will have participant in it. 4) If there is any update in the discussion then participants of the discussion will get notifications. 5) A user can observe his friends by adding them to his observed list.if an observed person creates any discussion a notification will be sent to his observers. 6) Any user can view list of his observers and list of users he/she is observing. 7) Every user can create his profile on website .He can put his picture ,title and tags. 8) Every discussion will have profile on website .It will have picture ,title and tags. 9) Any user of the website can search people or discussions based on the tags associated with the users and discussions.For example If user A has 3 tags in his profile like cooking,continental and Asian and user B has cooking and Asian in his tags and there is discussion named D1 on website which has tags continental and chines then if any user search for keyword continental user A and discussion D1 should come as search results. 10) If a user has created a discussion all the participants of that discussion will be added to his work group.For example let us say there are 4 users A,B,C,D and A creates a discussion named D1 and add user B,C in it.then work group of A will have B and C in it. Work group of B will have A and C in it.Work group of C will have A and B in it.Now if user D creates discussion named D2 and add C as participant in it then work group of D will have C in it.work group of C will now have A,B and D in it.In other words work group is list of all the users with whom a user is participating in any discussion. Its GUI will be as below 1) After log in, user Home page will be shown.On the home page there will be right bar and main content area. In the right bar we will show a) His 10 recent active friends along with link to see all his friends list and total count of his friends. b) His 10 recent discussions created by him with link to see list of all discussions created by him and total count of his discussions. c) 10 recent discussion in which he is participant with link to see list of all discussions in which he his participant and total count of his discussions. d) 10 recent active user to whom he is observing along with link to see list of all observed user and total count of user observed. f) 10 recent active user who are observing him along with link to see list of all his observers and total count of users observing. g) 10 recent active users from his work group along with link to see list of all the users in work group.(Work group is list of all the participants of all discussions in which user is participating) and total count of his work group. In the Main Content we will have a) Initially after log in it will display all the notifications of the user. b) If user click on any link in the right bar then result of that action will be displayed in main content. To implement this I have written following entities.I do not know whether it is the best way to do it .Please help me to know how we can improve this . I am planing to keep Discussion , Message , Workgroup , Notification in one entity group. package com.test; import java.io.Serializable; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Key; @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Discussion implements Serializable{ private static final long serialVersionUID = -9115235415573154018L; @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private String title; @Persistent private String createdBy; @Persistent private Date creationDate; @Persistent private String profileImagePath; @Persistent(defaultFetchGroup = true) private SetString tags; @Persistent(defaultFetchGroup=true) private SetString participants; public Discussion(Key key, String title, String createdBy, Date creationDate, String profileImagePath) { super(); this.key = key; this.title = title;
Re: [appengine-java] Re: Session object or memcache?
can anybody provide good link for dos and donts for high traffic apps ? On Sun, Jun 13, 2010 at 11:52 AM, nischalshetty nischalshett...@gmail.comwrote: Session isn't lost but session use is discouraged. You have memcache which is pretty fast in retrieval. Of course, every once a while even the memcache can be invalidated due to various reasons. While relying on memcache you need to be sure that in case the value returned is null query the datastore. My app gets high traffic every hour. I do keep the user object in session and haven't come across any problems yet. -N On Jun 13, 6:33 am, Thomas mylee...@gmail.com wrote: Session is cached in memcache and persisted to datastore. So when loading request occurs it won't be lost if it is not expired. You can view session (_ah_SESSION) data with datastore viewer. On 6月11日, 下午11時09分, Rahul rahul.jun...@gmail.com wrote: No doubt if your application is low traffic you will definitely need memcache as session will be lost every minute when the jvm restarts and you need to reload everything and also session is highly discouraged due to various reasons. Thanks, Rahul -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Need help in writing a query
Instead of getting these values with query best option is to store this values when you add new employee.So create one more dataset with fields city, area and employeecount.whenever you add new employee update the count .then you can get the count with simple query select employeecount from newdataset where city==city area==area On Sat, Jun 12, 2010 at 8:05 PM, Vik vik@gmail.com wrote: Hie I have following data set: City, Area emp-name and have to write a query which shows number of employees by city and area. So data should display like: Delhirohini 5 Delhinehru10 Hyd madhapur 6 Hyd hitech 24 Cheanni park 20 So what the query should be? Please advise Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Need help in writing a query
or you can use select count(this) from entityname where city==city area==area On Sat, Jun 12, 2010 at 8:24 PM, RAVINDER MAAN rsmaan...@gmail.com wrote: Instead of getting these values with query best option is to store this values when you add new employee.So create one more dataset with fields city, area and employeecount.whenever you add new employee update the count .then you can get the count with simple query select employeecount from newdataset where city==city area==area On Sat, Jun 12, 2010 at 8:05 PM, Vik vik@gmail.com wrote: Hie I have following data set: City, Area emp-name and have to write a query which shows number of employees by city and area. So data should display like: Delhirohini 5 Delhinehru10 Hyd madhapur 6 Hyd hitech 24 Cheanni park 20 So what the query should be? Please advise Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Session object or memcache?
Hello all what is the best option from performance point of view, storing frequently used objects in session or loading from datastore for every request(we can add memcache support before trying to fetch from datastore).Can anybody tell me good link to develop high performance and fast application development best practices link.I am using java with JDO. thanks in advance. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Records Count
How can we get records count for a query in JDO. In sql we have select count(*) from table_name i want to get number of records returned by a query. what is the efficient way to do that.One option is to use size() function .I think it is not best way. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Records Count
Thanks for your reply Ravi let me explain the entire scenario.I have an employee entity .User can search employees by giving part of name .There are four type of employees .I have to show number of employees matching user search criteria for every type of employee under different tabs.Actual results are to be displayed only if user open that tab. In SQL term we could write following query Select count(*) from employee where name like '%searchname%' and type ='A' ; My first problem is that i dint find any equivalent of like operator.Is there any way to do it? Secondly we can not keep record count for each search combination.what will you suggest for this case? Thanks once again. On Fri, Jun 11, 2010 at 4:23 PM, Ravi ping2r...@gmail.com wrote: Google app engine designed to work for any numbers of records with in minimum time, so SQL features like counting the records whenever needed is not supported. So you need to take care of such counter by urself at the time of adding or deleting the records in a table/entity. If you just want total number of records and dont care if counting happened in last 24 hours then look into low level api for datastore statistics, GAE refreshes total count every 24 hours and you can read the total count from there. And if you want count of records with some where clause, then you need to maintain it. like if u want like this select count(0) from tb where tb.propA='someValue' then you may need to create a new entity say counterForTb, and have few fields entityName and count and where clause columns and whenevr you add a new record in tb then increase the count of that record in counter table and on delete decrease it. Something for google guys Just realized that all columns are indexed unless we specify to not to index, and there must be some index meta data/statistics saved somewhere in google data stores about index(like total records matching to this index). And if that stats can be accessible through some APIs then we may be able to get total count just by reading data from indexes stats. Is this something feasible? On Jun 11, 11:39 am, RAVINDER MAAN rsmaan...@gmail.com wrote: How can we get records count for a query in JDO. In sql we have select count(*) from table_name i want to get number of records returned by a query. what is the efficient way to do that.One option is to use size() function .I think it is not best way. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Records Count
number of employee entities is going to be high .So i guess that possibility of getting more then 1000 employees for any search is quite high. On Fri, Jun 11, 2010 at 6:56 PM, John Patterson jdpatter...@gmail.comwrote: A lot depends on how many Employee entities you have. You could do a sub search for each of the 4 employee types and use COUNT to get the results. This will only work up to 1000 employees per employee type. Twig can execute queries in parallel so this would take no more time than running your original query. On 11 Jun 2010, at 19:39, RAVINDER MAAN wrote: Thanks for your reply Ravi let me explain the entire scenario.I have an employee entity .User can search employees by giving part of name .There are four type of employees .I have to show number of employees matching user search criteria for every type of employee under different tabs.Actual results are to be displayed only if user open that tab. In SQL term we could write following query Select count(*) from employee where name like '%searchname%' and type ='A' ; My first problem is that i dint find any equivalent of like operator.Is there any way to do it? Secondly we can not keep record count for each search combination.what will you suggest for this case? Thanks once again. On Fri, Jun 11, 2010 at 4:23 PM, Ravi ping2r...@gmail.com wrote: Google app engine designed to work for any numbers of records with in minimum time, so SQL features like counting the records whenever needed is not supported. So you need to take care of such counter by urself at the time of adding or deleting the records in a table/entity. If you just want total number of records and dont care if counting happened in last 24 hours then look into low level api for datastore statistics, GAE refreshes total count every 24 hours and you can read the total count from there. And if you want count of records with some where clause, then you need to maintain it. like if u want like this select count(0) from tb where tb.propA='someValue' then you may need to create a new entity say counterForTb, and have few fields entityName and count and where clause columns and whenevr you add a new record in tb then increase the count of that record in counter table and on delete decrease it. Something for google guys Just realized that all columns are indexed unless we specify to not to index, and there must be some index meta data/statistics saved somewhere in google data stores about index(like total records matching to this index). And if that stats can be accessible through some APIs then we may be able to get total count just by reading data from indexes stats. Is this something feasible? On Jun 11, 11:39 am, RAVINDER MAAN rsmaan...@gmail.com wrote: How can we get records count for a query in JDO. In sql we have select count(*) from table_name i want to get number of records returned by a query. what is the efficient way to do that.One option is to use size() function .I think it is not best way. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Records Count
No Ravi I did not find any solution yet.Neither for like nor for count.Its such a basic thing it think there must be a way.I dont see any reply from google people too. On Fri, Jun 11, 2010 at 8:12 PM, Ravi ping2r...@gmail.com wrote: Have u solved the problem of like SQL? If yes then please share with me as i have not been able to solve it. On Jun 11, 2:53 pm, RAVINDER MAAN rsmaan...@gmail.com wrote: number of employee entities is going to be high .So i guess that possibility of getting more then 1000 employees for any search is quite high. On Fri, Jun 11, 2010 at 6:56 PM, John Patterson jdpatter...@gmail.com wrote: A lot depends on how many Employee entities you have. You could do a sub search for each of the 4 employee types and use COUNT to get the results. This will only work up to 1000 employees per employee type. Twig can execute queries in parallel so this would take no more time than running your original query. On 11 Jun 2010, at 19:39, RAVINDER MAAN wrote: Thanks for your reply Ravi let me explain the entire scenario.I have an employee entity .User can search employees by giving part of name .There are four type of employees .I have to show number of employees matching user search criteria for every type of employee under different tabs.Actual results are to be displayed only if user open that tab. In SQL term we could write following query Select count(*) from employee where name like '%searchname%' and type ='A' ; My first problem is that i dint find any equivalent of like operator.Is there any way to do it? Secondly we can not keep record count for each search combination.what will you suggest for this case? Thanks once again. On Fri, Jun 11, 2010 at 4:23 PM, Ravi ping2r...@gmail.com wrote: Google app engine designed to work for any numbers of records with in minimum time, so SQL features like counting the records whenever needed is not supported. So you need to take care of such counter by urself at the time of adding or deleting the records in a table/entity. If you just want total number of records and dont care if counting happened in last 24 hours then look into low level api for datastore statistics, GAE refreshes total count every 24 hours and you can read the total count from there. And if you want count of records with some where clause, then you need to maintain it. like if u want like this select count(0) from tb where tb.propA='someValue' then you may need to create a new entity say counterForTb, and have few fields entityName and count and where clause columns and whenevr you add a new record in tb then increase the count of that record in counter table and on delete decrease it. Something for google guys Just realized that all columns are indexed unless we specify to not to index, and there must be some index meta data/statistics saved somewhere in google data stores about index(like total records matching to this index). And if that stats can be accessible through some APIs then we may be able to get total count just by reading data from indexes stats. Is this something feasible? On Jun 11, 11:39 am, RAVINDER MAAN rsmaan...@gmail.com wrote: How can we get records count for a query in JDO. In sql we have select count(*) from table_name i want to get number of records returned by a query. what is the efficient way to do that.One option is to use size() function .I think it is not best way. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr
Re: [appengine-java] Re: Session object or memcache?
I was not aware about loss of session objects.strange!! On Fri, Jun 11, 2010 at 8:39 PM, Rahul rahul.jun...@gmail.com wrote: No doubt if your application is low traffic you will definitely need memcache as session will be lost every minute when the jvm restarts and you need to reload everything and also session is highly discouraged due to various reasons. Thanks, Rahul On Jun 11, 4:16 am, RAVINDER MAAN rsmaan...@gmail.com wrote: Hello all what is the best option from performance point of view, storing frequently used objects in session or loading from datastore for every request(we can add memcache support before trying to fetch from datastore).Can anybody tell me good link to develop high performance and fast application development best practices link.I am using java with JDO. thanks in advance. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Records Count
thanks john any thought for like operator of sql.how can we implement like operator of sql in GAE On Fri, Jun 11, 2010 at 8:49 PM, John Patterson jdpatter...@gmail.comwrote: The best you could probably do is load into memory a structure that keeps the employee type for every employee. When the user types some letters of a name to search for you can perform a keys-only query and lookup the employee type in this structure (rather than load the entity) You would need 2 bits per employee (for 4 types) so even a million employees would only require 250KB of memory (an array of 30K longs) which shouldn't take too long to read from memcache when an instance starts. You would then need to iterate over every result and count which type the employee is. To optimise this you might cache the counts in memcache of 1 and 2 letter searches. So then you would only need to count on the fly three letter searches i.e. all employees with names starting with smi On 11 Jun 2010, at 20:53, RAVINDER MAAN wrote: number of employee entities is going to be high .So i guess that possibility of getting more then 1000 employees for any search is quite high. On Fri, Jun 11, 2010 at 6:56 PM, John Patterson jdpatter...@gmail.comwrote: A lot depends on how many Employee entities you have. You could do a sub search for each of the 4 employee types and use COUNT to get the results. This will only work up to 1000 employees per employee type. Twig can execute queries in parallel so this would take no more time than running your original query. On 11 Jun 2010, at 19:39, RAVINDER MAAN wrote: Thanks for your reply Ravi let me explain the entire scenario.I have an employee entity .User can search employees by giving part of name .There are four type of employees .I have to show number of employees matching user search criteria for every type of employee under different tabs.Actual results are to be displayed only if user open that tab. In SQL term we could write following query Select count(*) from employee where name like '%searchname%' and type ='A' ; My first problem is that i dint find any equivalent of like operator.Is there any way to do it? Secondly we can not keep record count for each search combination.what will you suggest for this case? Thanks once again. On Fri, Jun 11, 2010 at 4:23 PM, Ravi ping2r...@gmail.com wrote: Google app engine designed to work for any numbers of records with in minimum time, so SQL features like counting the records whenever needed is not supported. So you need to take care of such counter by urself at the time of adding or deleting the records in a table/entity. If you just want total number of records and dont care if counting happened in last 24 hours then look into low level api for datastore statistics, GAE refreshes total count every 24 hours and you can read the total count from there. And if you want count of records with some where clause, then you need to maintain it. like if u want like this select count(0) from tb where tb.propA='someValue' then you may need to create a new entity say counterForTb, and have few fields entityName and count and where clause columns and whenevr you add a new record in tb then increase the count of that record in counter table and on delete decrease it. Something for google guys Just realized that all columns are indexed unless we specify to not to index, and there must be some index meta data/statistics saved somewhere in google data stores about index(like total records matching to this index). And if that stats can be accessible through some APIs then we may be able to get total count just by reading data from indexes stats. Is this something feasible? On Jun 11, 11:39 am, RAVINDER MAAN rsmaan...@gmail.com wrote: How can we get records count for a query in JDO. In sql we have select count(*) from table_name i want to get number of records returned by a query. what is the efficient way to do that.One option is to use size() function .I think it is not best way. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received
Re: [appengine-java] Re: Date based sorting and result pagination
I am using JDO .So which option is best cursors or setRange? On Wed, Jun 9, 2010 at 1:47 PM, Nacho Coloma icol...@gmail.com wrote: You should specify if you are using JDO, JPA or other. SimpleDS has a PagedQuery implementation that can be ported to your own environment. Look for getFetchOptions() in this link: http://code.google.com/p/simpleds/source/browse/trunk/src/main/java/org/simpleds/PagedQuery.java This will only resolve the paging, and it's not optimal but convenient (can jump to a specific page etc). For an optimal solution, use cursors. On Jun 9, 7:36 am, RAVINDER MAAN rsmaan...@gmail.com wrote: Hello all how can i get my query result sorted based on creationdate and also i want to do pagination for the same.what is the best way to do that.can anybody refer me any example code? Thanks -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] SQL Like operator with %
Hello all how we can we implement SQL like operator in java JDO query. how can I write this query in JDO select * from employee where name like '%james%'; Employee is entity with property name. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Date based sorting and result pagination
Thanks Ravi .. So nice of you. On Fri, Jun 11, 2010 at 12:37 AM, Ravi Sharma ping2r...@gmail.com wrote: you are already sorting on date..and that can be best candidate for paging too but u may need indexes in both direction(asc,desc) for creation date. lets say ur entity has fololowing prooerty on which u will fliter propA propB creationData so u will write basic query like select * from entity where propA='something' and propB='xyz' order by creationDate asc. once you get this result, keep this first record's creation date and last record's date, may be send it to client and attach it to prev, next links. At this stage prev will be null(as its start of the paging.i.e. first page) and next will be creation date of last record. If user click Next execute a query like this select * from entity where propA='something' and propB='xyz' and creationDatedateSuppliedByClient order by creationDate asc..Here dateSuppliedByClient is creationDate of last record of above query. again do the same thing bind the creationDate first record to previous and last record to Next. so for every next you will keep executing second query now if user click previous, then execute bit different query select * from entity where propA='something' and propB='xyz' and creationDatedateSuppliedByClient order by creationDate *desc*.Here dateSuppliedByClient is creationDate of first record of above query. NOTE : creationDate condition clause has changed and sorting order has changed So u will have following Indexes propA ^ propB^ creationDate^ propA ^ propB^ creationDate(Desc) On Thu, Jun 10, 2010 at 7:34 PM, RAVINDER MAAN rsmaan...@gmail.comwrote: I forsee that there will be around 100 records or entities in one table.I have to do filtering based on one or two ,sorting based on creation date then display results through pagination with back and forth traversing of records.so what will be the best strategy in this case. On Thu, Jun 10, 2010 at 10:31 PM, Nacho Coloma icol...@gmail.com wrote: Cursors is the best choice, but they can only be used to paginate forward. You will have to use your own hacks to allow more than one page. setRange() is more flexible, but should give you worse performance. On Jun 10, 3:27 pm, RAVINDER MAAN rsmaan...@gmail.com wrote: I am using JDO .So which option is best cursors or setRange? On Wed, Jun 9, 2010 at 1:47 PM, Nacho Coloma icol...@gmail.com wrote: You should specify if you are using JDO, JPA or other. SimpleDS has a PagedQuery implementation that can be ported to your own environment. Look for getFetchOptions() in this link: http://code.google.com/p/simpleds/source/browse/trunk/src/main/java/o... This will only resolve the paging, and it's not optimal but convenient (can jump to a specific page etc). For an optimal solution, use cursors. On Jun 9, 7:36 am, RAVINDER MAAN rsmaan...@gmail.com wrote: Hello all how can i get my query result sorted based on creationdate and also i want to do pagination for the same.what is the best way to do that.can anybody refer me any example code? Thanks -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle
[appengine-java] Date based sorting and result pagination
Hello all how can i get my query result sorted based on creationdate and also i want to do pagination for the same.what is the best way to do that.can anybody refer me any example code? Thanks -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] simple relation
Hello all can anybody please tell me how to implement simple one many relation in java.I have user table and work table .Any user can do many type of works.In user table i have userid but it is not primary key of the user table.Then i have work table which has workid it is also not primary key of the table.Normally in relation db we ca make third table table which contains workid for every userid.What how can we implement this thing appengine datastore.I want to have collection all works in user object .can anybody please tell me how to define this mapping?please note that in userid and workid are not primary keys in both objects or tables. Thanks in adavance. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] simple relation
Thank you so much for your answer Bill yes you are rite the way i wrote its many to many relation.Actually I want relation as below class User{ Long id; String username; ListWork workList; } class Work{ Long id; String workname; String username; } you can see work class has username and user class too has username.In both classes primary key is id. I just want to know is there any way to get workList populated automatically on retrieval of user object.we can do it with 2 queries easily.we can reteriev user first then we can retrieve work object with second query. On Wed, Jun 2, 2010 at 10:35 PM, Bill Milligan bill.milli...@gmail.comwrote: Are you trying one-to-many or many-to-many? By using a third table it sounds like you're trying to do many-to-many, not one-to-many. As best I can determine, the only real way to do this in GAE is to have a User class with a collection of string properties, containing the list of all Work ids. In this case a bidirectional link would be probably quite useful, so that a Work could be identified by its User id. Here's a scenario: Retrieve User by user id. Then, retrieve all Works in the list of work ids owned by the User. Note that this is not true object composition, with a User containing a List of Collection, but rather an indirect reference. This pattern is useful in a lot of circumstances where you want to be able to break up your object model into more modular deployable applications. On the other hand, I'd hate to be completely boxed in by this restriction. I'm just getting started with GAE so I'm very much not an expert. I'd love to know anybody else's thoughts on the matter. On Wed, Jun 2, 2010 at 12:10 AM, RAVINDER MAAN rsmaan...@gmail.comwrote: Hello all can anybody please tell me how to implement simple one many relation in java.I have user table and work table .Any user can do many type of works.In user table i have userid but it is not primary key of the user table.Then i have work table which has workid it is also not primary key of the table.Normally in relation db we ca make third table table which contains workid for every userid.What how can we implement this thing appengine datastore.I want to have collection all works in user object .can anybody please tell me how to define this mapping?please note that in userid and workid are not primary keys in both objects or tables. Thanks in adavance. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] simple relation
Thanks Bill I have experience with hibernate thats why i thought it could be possible. On Thu, Jun 3, 2010 at 12:00 AM, Bill Milligan bill.milli...@gmail.comwrote: I believe you're going to have to change this to class User { String name; List String workNames; // or List Long workIds; } class Work { String name; String userName; // or Long userId; } This is actually you'd design this under the MDA paradigm, actually. You need to be able to change each independently of the other. As far as automatic population, like an ORM would do, I don't think this is possible. You'll have to do this manually. Honestly, you won't lose much by doing two queries. On Wed, Jun 2, 2010 at 2:12 PM, RAVINDER MAAN rsmaan...@gmail.com wrote: Thank you so much for your answer Bill yes you are rite the way i wrote its many to many relation.Actually I want relation as below class User{ Long id; String username; ListWork workList; } class Work{ Long id; String workname; String username; } you can see work class has username and user class too has username.In both classes primary key is id. I just want to know is there any way to get workList populated automatically on retrieval of user object.we can do it with 2 queries easily.we can reteriev user first then we can retrieve work object with second query. On Wed, Jun 2, 2010 at 10:35 PM, Bill Milligan bill.milli...@gmail.comwrote: Are you trying one-to-many or many-to-many? By using a third table it sounds like you're trying to do many-to-many, not one-to-many. As best I can determine, the only real way to do this in GAE is to have a User class with a collection of string properties, containing the list of all Work ids. In this case a bidirectional link would be probably quite useful, so that a Work could be identified by its User id. Here's a scenario: Retrieve User by user id. Then, retrieve all Works in the list of work ids owned by the User. Note that this is not true object composition, with a User containing a List of Collection, but rather an indirect reference. This pattern is useful in a lot of circumstances where you want to be able to break up your object model into more modular deployable applications. On the other hand, I'd hate to be completely boxed in by this restriction. I'm just getting started with GAE so I'm very much not an expert. I'd love to know anybody else's thoughts on the matter. On Wed, Jun 2, 2010 at 12:10 AM, RAVINDER MAAN rsmaan...@gmail.comwrote: Hello all can anybody please tell me how to implement simple one many relation in java.I have user table and work table .Any user can do many type of works.In user table i have userid but it is not primary key of the user table.Then i have work table which has workid it is also not primary key of the table.Normally in relation db we ca make third table table which contains workid for every userid.What how can we implement this thing appengine datastore.I want to have collection all works in user object .can anybody please tell me how to define this mapping?please note that in userid and workid are not primary keys in both objects or tables. Thanks in adavance. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group
Re: [appengine-java] stuck indexes ?
I see same problem it takes hours to build indexes.is there any faster way? On Thu, Jun 3, 2010 at 10:03 AM, Bruce h...@alum.rpi.edu wrote: Hi, I have an app at 'omwatcher.appspot.com' with a very small database, yet two indexes seem to be stuck with Status=Building. Can someone help? Thanks. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Regards, Ravinder Singh Maan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.