[appengine-java] Enabling compile-time weaving
Hi everyone, can anyone tell me how to enable compile-time weaving for aspectj? Thanks a lot... -- 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] Re: Local Unit Testing with UserService: userId==null problem
I have the same Problem, did you fix your problem? Please tell me how you did it. Thanks Poe On 30 Jun., 12:18, "Dmitriy T." <403...@gmail.com> wrote: > I use LocalUnitTesting and recently change auth system and start > using userService.getCurrentUser().getUserId() for identification. > Problem is that its always return null in Local Testing > (federatedIdentity==null too). For many reasons that unacceptable for > me. > > Is that unfixable, or exist something like setUserId for > LocalServiceTestHelper? -- 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] Re: Datastore.Text didn't work after deploy
Hi Ian, thanks for your reply. 1. :-/ 2. What is the difference? 3. Thats how i did it, yes. Is there another way to story text with more than 500 letters? Simple String won't work as far as I know. Thanks Poe On 27 Jul., 12:45, Ian Marshall wrote: > 1. I know that the Google team will say that the dev app server is > only an approximation to the GAE cloud > > 2. I always use transactions when I am persisting. > > 3. I don't know how you are persisting your text. Is it like this? > > String sContent = ... > Text txtContent = null; > if (sContent != null) > txtContent = new Text(sContent); > entry.setContent(txtContent); > > That's all I can think of. > > On Jul 27, 11:01 am, poe wrote: > > > > > The Class for the datastore: > > > @PersistenceCapable > > public class GuestbookEntry { > > > ... > > > @persistent(defaultFetchGroup ="true") > > private Text content; > > > ... > > > } > > > Thats how I store it: > > > public void add(String title, String content) { > > > PersistenceManager pm = PMF().get().getPersistenceManager(); > > > GuestbookEntry entry = new GuestbookEntry(title, content); > > > try { > > pm.makePersistent(entry); > > > } finally { > > pm.close(); > > } > > > } > > > Just how they described it in the appengine docs. As I say, it works > > pretty fine in development and production mode locally. Am I missing > > something? > > > It's like google appengine didn't know the class datastore.text, there > > is a null value for the class type in the datastore viewer for the > > field content. > > > Thanks for your help > > Greets > > Poe > > > On 27 Jul., 10:22, Ian Marshall wrote: > > > > Have you got any code fragments? > > > > On Jul 27, 9:03 am, poe wrote: > > > > > I still don't know what the problem is. Please, some help. :-) > > > > > On 25 Jul., 11:25, poe wrote: > > > > > > Nope, that didn't solve the problem. Another strange thing is, when I > > > > > query on the entities I only get one result on the appengine server, > > > > > locally I get all results that are assigned to the user. Another > > > > > strange thing is, that the datastore viewer in the appengine admin > > > > > area shows a "null" value for the fields type. > > > > > > Thanks everyone for your help, > > > > > Greets > > > > > Poe > > > > > > On 25 Jul., 10:40, Ian Marshall wrote: > > > > > > > Is this field in your fetch group when you retrieve data. I use the > > > > > > following way to ensure that a field is in my default fetch group: > > > > > > > @Persistent(defaultFetchGroup="true") > > > > > > private Text content; > > > > > > > On Jul 24, 10:34 pm, poe wrote: > > > > > > > > Hi everyone, > > > > > > > > i've implemented a small application with > > > > > > > > ... > > > > > > > > @Persistent > > > > > > > private Text content; > > > > > > > > ... > > > > > > > > When I test it locally and store this into the datastore > > > > > > > everything > > > > > > > works fine, when i deploy the app nothing get stored in that field > > > > > > > "content". What am I doing wrong? I see no errors or exceptions > > > > > > > in the > > > > > > > admin menu. > > > > > > > > Greets > > > > > > > Poe -- 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] Re: Datastore.Text didn't work after deploy
The Class for the datastore: @PersistenceCapable public class GuestbookEntry { ... @persistent(defaultFetchGroup ="true") private Text content; ... } Thats how I store it: public void add(String title, String content) { PersistenceManager pm = PMF().get().getPersistenceManager(); GuestbookEntry entry = new GuestbookEntry(title, content); try { pm.makePersistent(entry); } finally { pm.close(); } } Just how they described it in the appengine docs. As I say, it works pretty fine in development and production mode locally. Am I missing something? It's like google appengine didn't know the class datastore.text, there is a null value for the class type in the datastore viewer for the field content. Thanks for your help Greets Poe On 27 Jul., 10:22, Ian Marshall wrote: > Have you got any code fragments? > > On Jul 27, 9:03 am, poe wrote: > > > > > I still don't know what the problem is. Please, some help. :-) > > > On 25 Jul., 11:25, poe wrote: > > > > Nope, that didn't solve the problem. Another strange thing is, when I > > > query on the entities I only get one result on the appengine server, > > > locally I get all results that are assigned to the user. Another > > > strange thing is, that the datastore viewer in the appengine admin > > > area shows a "null" value for the fields type. > > > > Thanks everyone for your help, > > > Greets > > > Poe > > > > On 25 Jul., 10:40, Ian Marshall wrote: > > > > > Is this field in your fetch group when you retrieve data. I use the > > > > following way to ensure that a field is in my default fetch group: > > > > > @Persistent(defaultFetchGroup="true") > > > > private Text content; > > > > > On Jul 24, 10:34 pm, poe wrote: > > > > > > Hi everyone, > > > > > > i've implemented a small application with > > > > > > ... > > > > > > @Persistent > > > > > private Text content; > > > > > > ... > > > > > > When I test it locally and store this into the datastore everything > > > > > works fine, when i deploy the app nothing get stored in that field > > > > > "content". What am I doing wrong? I see no errors or exceptions in the > > > > > admin menu. > > > > > > Greets > > > > > Poe -- 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] Re: Datastore.Text didn't work after deploy
I still don't know what the problem is. Please, some help. :-) On 25 Jul., 11:25, poe wrote: > Nope, that didn't solve the problem. Another strange thing is, when I > query on the entities I only get one result on the appengine server, > locally I get all results that are assigned to the user. Another > strange thing is, that the datastore viewer in the appengine admin > area shows a "null" value for the fields type. > > Thanks everyone for your help, > Greets > Poe > > On 25 Jul., 10:40, Ian Marshall wrote: > > > > > Is this field in your fetch group when you retrieve data. I use the > > following way to ensure that a field is in my default fetch group: > > > @Persistent(defaultFetchGroup="true") > > private Text content; > > > On Jul 24, 10:34 pm, poe wrote: > > > > Hi everyone, > > > > i've implemented a small application with > > > > ... > > > > @Persistent > > > private Text content; > > > > ... > > > > When I test it locally and store this into the datastore everything > > > works fine, when i deploy the app nothing get stored in that field > > > "content". What am I doing wrong? I see no errors or exceptions in the > > > admin menu. > > > > Greets > > > Poe -- 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] Re: Datastore.Text didn't work after deploy
Nope, that didn't solve the problem. Another strange thing is, when I query on the entities I only get one result on the appengine server, locally I get all results that are assigned to the user. Another strange thing is, that the datastore viewer in the appengine admin area shows a "null" value for the fields type. Thanks everyone for your help, Greets Poe On 25 Jul., 10:40, Ian Marshall wrote: > Is this field in your fetch group when you retrieve data. I use the > following way to ensure that a field is in my default fetch group: > > @Persistent(defaultFetchGroup="true") > private Text content; > > On Jul 24, 10:34 pm, poe wrote: > > > > > Hi everyone, > > > i've implemented a small application with > > > ... > > > @Persistent > > private Text content; > > > ... > > > When I test it locally and store this into the datastore everything > > works fine, when i deploy the app nothing get stored in that field > > "content". What am I doing wrong? I see no errors or exceptions in the > > admin menu. > > > Greets > > Poe -- 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] Datastore.Text didn't work after deploy
Hi everyone, i've implemented a small application with ... @Persistent private Text content; ... When I test it locally and store this into the datastore everything works fine, when i deploy the app nothing get stored in that field "content". What am I doing wrong? I see no errors or exceptions in the admin menu. Greets Poe -- 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] Testing a remoteService that execute datastore operations
Hi everyone, i want to test a remoteService that performs operations on a datastore with jdo. For example: public class UserServiceImpl extends RemoteServiceServlet implements UserService { public User addUser(User u) { PersistenceManager pm = PMF.get().getPersistenceManager(); try { pm.makePersistent(u); } finally { pm.close(); } return u; }; public User updateUser(User u) { ... } ... } how can i implement a test case, that tests the listed operations, so that the datastore operations didn't effect my development datastore (maybe does some memcache operations or so?). I hope you get what i mean :-) tell me if you need more information. Thanks and greetings, Poe -- 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] Re: Confused by jdo relationships
Hi Ravi, the relation is still a one to one relation because the categoryGroupRelation holds a categoryId as a primary Key, so the relation only holds one or zero categoryId for ever Category and thereby every Category has only one CategoryGroup. But my question is more about design principles. Isn't it better to separate the data from relations? Lets say you create a User class on the first Version of you App. You store thinks like eMail, names, birthdays and so on in this class. In a second version of you App you want to extend the database schema with user groups. By then you only need to add two new classes Groups and UserGroupsRelations to accomplish this and don't need to extends or alter the original User class (Think about altering all the old User objects that are still in the datastore, what are the inital values for this new attribute?). There is another advantage: If you implement the userGroups relation in the UserClass you only get all Users from one Group by making a query over all Users insted of just checking the relations. You could simply get allUsersFromAGroup and allGroupsFromAUser over this class. Tell me how you would implement this and what are your experiences? Thanks and greetings Poe On 7 Jul., 16:46, Ravi Sharma wrote: > Hi Poe, > You have just implemented relational many to many relation. > > But this design is perfectly fine but just think if you need one to many > relation only then in your case you will be writing 2 entities while u could > just write one by saving catehoryGroup id in category it self. > And when u want to read category and catehorygroup, u need to read three > entities while u could read just two. > > So for one to many relations I will use unowned relation and save some write > and read :). > > GAE doesn't say u can't think relational :). > > Thanks > Ravi > > Sent from my iPhone > > On 7 Jul 2010, at 15:18, poe wrote: > > > > > I've got a question regarding this. > > > Isn't it kind of "nicer" regarding the design to not store relational > > Attributes in a core table/class. In the given example I would > > implement this like this: > > > @PersistenceCapable > > public class Categories > > { > > �...@primarykey > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Long Id; > > > No owned or unowner object here > > ... > > } > > > @PersistenceCapable > > public class CategoryGroups > > { > > �...@primarykey > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Long Id; > > ... > > } > > > @PersistenceCapable > > public class CategoryGroupRelation { > > > @PrimaryKey > > @Persistent(mappedBy="category") > > private Long categoryId; > > > @Persistent(mappedBy="categorygroups" > > private Long categoryGroupId; > > > } > > > Isn't it better to design the tables this way? I don't like relational > > attributes in a core database class. What do you think? > > > Greets > > Poe > > > On 7 Jul., 01:25, AC wrote: > >> Thanks. That answers my question. > > >> On Jul 6, 3:18 pm, Ravi Sharma wrote: > > >>> You need to understand the concept of Entity group here, and need to > >>> understand the owned relation and unowned relation. > >>> Think of owned and unowned relation like this > >>> You(your house) and your TV has owned relationship, your house has TV, no > >>> ne > >>> can see it from outside, and if your friend want the same tv he need to > >>> buy > >>> the same TV and own it. And at one point if you ask who all watching my TV > >>> then it will be just you not your friend as he has his own TV(although > >>> same > >>> kind of TV). > > >>> But You and your favourite movie theatre has unowned relationship, you > >>> dont > >>> own it, anyone who knows the address of theatre can go and watch movie. > >>> and > >>> at one moment 1000s of people might be watching the same movie/theatre > > >>> Back to your question. > > >>> Categories(3)/CategoryGroups(4) is an example for owned relation. > >>> CategoryGroup(4) will be available to Category(3) only and if you create > >>> another category Cateory(10) with same category group it will just create > >>> another version of categoryGroup CategoryGroup(11) in that category. But > >>> you > >>> may see that CategoryGroup 11 and C
[appengine-java] Re: Confused by jdo relationships
I've got a question regarding this. Isn't it kind of "nicer" regarding the design to not store relational Attributes in a core table/class. In the given example I would implement this like this: @PersistenceCapable public class Categories { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long Id; No owned or unowner object here ... } @PersistenceCapable public class CategoryGroups { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long Id; ... } @PersistenceCapable public class CategoryGroupRelation { @PrimaryKey @Persistent(mappedBy="category") private Long categoryId; @Persistent(mappedBy="categorygroups" private Long categoryGroupId; } Isn't it better to design the tables this way? I don't like relational attributes in a core database class. What do you think? Greets Poe On 7 Jul., 01:25, AC wrote: > Thanks. That answers my question. > > On Jul 6, 3:18 pm, Ravi Sharma wrote: > > > > > You need to understand the concept of Entity group here, and need to > > understand the owned relation and unowned relation. > > Think of owned and unowned relation like this > > You(your house) and your TV has owned relationship, your house has TV, no ne > > can see it from outside, and if your friend want the same tv he need to buy > > the same TV and own it. And at one point if you ask who all watching my TV > > then it will be just you not your friend as he has his own TV(although same > > kind of TV). > > > But You and your favourite movie theatre has unowned relationship, you dont > > own it, anyone who knows the address of theatre can go and watch movie. and > > at one moment 1000s of people might be watching the same movie/theatre > > > Back to your question. > > > Categories(3)/CategoryGroups(4) is an example for owned relation. > > CategoryGroup(4) will be available to Category(3) only and if you create > > another category Cateory(10) with same category group it will just create > > another version of categoryGroup CategoryGroup(11) in that category. But you > > may see that CategoryGroup 11 and CategoryGroup 4 both are Entertainment. > > > In your case many categories can have same categoryGroup.So instead of using > > owned relationship, you should use unowned relationship. > > > Instead of this > > @Persistent > > private CategoryGroups Group; > > > define this > > @Persistent > > private Key categoryGroupId; > > > and save key of CategoryGroup rather then full object. (Dont buy a TV for > > every other rmovie you want to watch, just buy a movie theatre ticket go > > there and use that :) ) > > > I hope u get the idea, you can learn more from here > > >http://code.google.com/appengine/docs/java/datastore/relationships.html > > > spare me if you dont like my example... :) > > > Ravi. > > > On Tue, Jul 6, 2010 at 5:47 PM, AC wrote: > > > I just started fooling around w/ GAE this weekend. > > > > I have a Categories class and a CategoryGroup class. The idea is that > > > every category must be grouped. For example the CategoryGroup > > > "Entertainment" can be assigned to many Categories, such as "movies", > > > "music" and "television". > > > > Here are my classes. > > > > @PersistenceCapable > > > public class Categories > > > { > > > �...@primarykey > > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > > private Key Id; > > > > �...@persistent > > > private CategoryGroups Group; > > > > �...@persistent > > > private boolean IsDeleted; > > > > �...@persistent > > > private String Name; > > > > �...@persistent > > > private Date CreateDate; > > > > �...@persistent > > > �...@column(allowsNull="true") > > > private Date ModifiedDate; > > > } > > > > @PersistenceCapable > > > public class CategoryGroups > > > { > > > �...@primarykey > > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > > private Key Id; > > > > �...@persistent > > > boolean IsDeleted; > > > > �...@persistent > > > String Name; > > > > �...@persistent > > > Date CreateDate; > > > > �...@persistent > > > �...@
[appengine-java] Re: No API environment is registered for this thread.
It seems that I've used my own Run Configuration where I included a wrong nucleus-appengine-something.jar in the classpath. When I added the Jar-File by hand the enhancer didn't work anymore. I created a new Run Configuration with the latest appengine version and it works. Are there some Documentation about how to set up the Developement Mode in the Run Configuration? Thanks so far Poe On 25 Mai, 18:21, "Ronmell (VDKiT)" wrote: > Hi Poe. > > Data Store comes with your GAE. no further installations. > > a little bit of more information related to the complete error and the > point of raising of the error, would be very helpful. > > R > > On May 25, 9:10 am, poe wrote: > > > > > Hey there, > > > when i want to store some Objects in the Datastore i get this error > > and the object is not added. This only happend when i use it in > > developement or production mode. Did I have to set up a Datastore or > > is it included in the appengine? > > > No API environment is registered for this thread. > > > Greets > > Poe > > > -- > > 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 > > athttp://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.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] No API environment is registered for this thread.
Hey there, when i want to store some Objects in the Datastore i get this error and the object is not added. This only happend when i use it in developement or production mode. Did I have to set up a Datastore or is it included in the appengine? No API environment is registered for this thread. Greets Poe -- 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.