Re: [appengine-java] Re: constructor expressions in JPAQL in GAE

2009-12-22 Thread Bombay Goose
Thanks Datanuclues team.

I know it is logical to just blame it on Datanucleus on GAE. But I gave it a
benefit of doubt.

Anyway, so is there any other way of getting objects with only the
properties that I specify? (The second part in the question).

Otherwise, it will just be a join and I will have to get individual
properties and then have a constructor, which again will involve lots of
reflection for each field for dynamically created objects.

Any help would be great.

On Tue, Dec 22, 2009 at 12:52 AM, datanucleus andy_jeffer...@yahoo.comwrote:

  ***Unsupported***DatastoreOperatorException:

 Which of your possible situations does that exception suggest ?

 --

 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.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] constructor expressions in JPAQL in GAE

2009-12-21 Thread Bombay Goose
Hi all,

Need some help in JPAQL in GAE. The JPAQL specs say that you can create
objects from a JPA query directly. e.g.

I wrote the following code


Query q = manager.createQuery(SELECT new com.test.Person(p.id, p.firstName,
p.lastName) from Person p);

*List* results = q.getResultList();

It threw the following exception.

org.datanucleus.store.appengine.query.DatastoreQuery$UnsupportedDatastoreOperatorException:
Problem with query SELECT new com.test.Person(p.id, p.firstName,
p.lastName) from Person p: App Engine datastore does not support operator
org.datanucleus.query.expression.CreatorExpression.

As per the JPA tutorial, constructor expressions are allowed.

Am I doing anything wrong here, or is appengine does not support it.

If the later is true, how do I solve this problem of selecting only
selective properties from an entity. Follow up question is what if there is
a one to many relationship between Person and Company, where person has a
lookup to Company and in the above query I want to get id of the company and
name of the company only and not other details like address, phone, etc.

Something similar in SQL, without the constructor expression would be

SELECT p.id, p.firstName, p.lastName, p.companyId, c.companyName from Person
p, Company c where p.companyId = c.id

OR in JPA QL

SELECT new Person(id, firstName, lastName, new Company(c.id, c.companyName)
from Person p, Company c where p.companyId = c.id

I am sure, the above expression is incorrect, but I want something to that
effect. Can I do this on GAE? This would help me design efficient queries
and still not take away OOness of JPA.

Any help is welcome.

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] Dynamically create classes using JPA/JDO and bytecode instrumentation

2009-12-21 Thread Bombay Goose
Thanks Ikai for 1.
Will definitely refer to the link in 2. and get back if I have more
questions.

Thanks for the quick help.

On Mon, Dec 21, 2009 at 9:38 AM, Ikai L (Google) ika...@google.com wrote:

 1. If you just delete all the entities of a single Kind, it is the same
 effect as deleting a table. You have to remember that the datastore is not
 SQL. Underneath the hood, it is a schemaless key-value store. Type
 information is defined within each entity itself and in the corresponding
 indexes.

 2. The solution that seems to fit for the most developers is to do multiple
 queries and join in memory. Another solution can be to precompute the result
 at write time and denormalize your schema so that you query on the
 denormalized field. Without knowing what you are doing, it can be difficult
 to recommend any particular workaround. I highly recommend watching the
 videos from Google I/O and reading the articles to understand how filtering
 and indexing works. This is a pretty good place to start:
 http://code.google.com/appengine/articles/datastore/overview.html


 On Fri, Dec 18, 2009 at 10:12 PM, Bombay Goose bombaygo...@gmail.comwrote:

 Thanks DataNucleus team and Toby.

 Sorry, but I have some more questions

 1. How do I delete a particular table dynamically? would just unloading
 the class do it? Iin that case, what if there are changes to the dynamic
 table, i.e. column addition/dropping, wouldnt that require unloading the
 class and hence deletion of table?
 2. I am going through the Queries and Indexes section in the documentation
 at
 http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html
  This section says that inequality operators are allowed only one
 property. Is anybody handling a situation where there are multiple
 properties with inequality operators? If yes, how have you done it?
 Thanks
   On Wed, Dec 16, 2009 at 12:18 PM, Toby Reyelts to...@google.comwrote:

 One other thing you might consider is using the native App Engine
 datastore, since it's already schemaless. You can even mix and match using
 the native API and JDO/JPA.

   On Wed, Dec 16, 2009 at 1:30 AM, Bombay Goose 
 bombaygo...@gmail.comwrote:

   Hello All,

 I am doing a feasibility study of whether we can develop our application
 on appengine or not.

 Our application has a requirement where we have to create tables
 dynamically, without restarting the application.

 Is that possible in Appengine?

 Datanucleus supports this through JDO, with some byte code
 instrumentation. More info -
 http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageId=6619188

 Is it possible through JPA? if yes, does appengine allow it?
  if not, does Appengine allow Bytecode instrumentation so that we
 can create classes dynamically according to the link above using JDO.

 Any help is greatly appreciated.

 Thanks,

 G

 --
 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.


  --
 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.




 --
 Ikai Lan
 Developer Programs Engineer, Google App Engine

  --
 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

Re: [appengine-java] Dynamically create classes using JPA/JDO and bytecode instrumentation

2009-12-18 Thread Bombay Goose
Thanks DataNucleus team and Toby.

Sorry, but I have some more questions

1. How do I delete a particular table dynamically? would just unloading the
class do it? Iin that case, what if there are changes to the dynamic table,
i.e. column addition/dropping, wouldnt that require unloading the class and
hence deletion of table?
2. I am going through the Queries and Indexes section in the documentation
at
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html
 This section says that inequality operators are allowed only one property.
Is anybody handling a situation where there are multiple properties with
inequality operators? If yes, how have you done it?
Thanks
On Wed, Dec 16, 2009 at 12:18 PM, Toby Reyelts to...@google.com wrote:

 One other thing you might consider is using the native App Engine
 datastore, since it's already schemaless. You can even mix and match using
 the native API and JDO/JPA.

   On Wed, Dec 16, 2009 at 1:30 AM, Bombay Goose bombaygo...@gmail.comwrote:

   Hello All,

 I am doing a feasibility study of whether we can develop our application
 on appengine or not.

 Our application has a requirement where we have to create tables
 dynamically, without restarting the application.

 Is that possible in Appengine?

 Datanucleus supports this through JDO, with some byte code
 instrumentation. More info -
 http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageId=6619188

 Is it possible through JPA? if yes, does appengine allow it?
  if not, does Appengine allow Bytecode instrumentation so that we can
 create classes dynamically according to the link above using JDO.

 Any help is greatly appreciated.

 Thanks,

 G

 --
 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.


--

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: Dynamically create classes using JPA/JDO and bytecode instrumentation

2009-12-16 Thread Bombay Goose
Thanks Datanucleus team,

I want to go ahead with JPA because that is a standard pushed by Sun itself.

Follow up question to the JPA -

If I add annotations and load the class, I will *NOT* have to *RESTART* the
server.
If I make changes to XML metadata file, I will have to *RESTART* the server.

Are those correct assumptions?

By the way, I attended Sun's Virtual conference yesterday and they were
coming out with JPA 2.0 with metadata APIs.

Hopefully that gets incorporated in Datanucleus soon.

Thanks for all the help
On Wed, Dec 16, 2009 at 4:41 AM, datanucleus andy_jeffer...@yahoo.comwrote:

  Is it possible through JPA? if yes, does appengine allow it?

 JPA doesn't provide a metadata API, so you'd have to extend that
 provided example to add on either annotations to the generated
 classes, or XML metadata file generation.

   if not, does Appengine allow Bytecode instrumentation so that we can
  create classes dynamically according to the link above using JDO.

 GAE/J provides access to JDO hence you can use anything that goes with
 it, obviously including bytecode enhancement (since that is what the
 DataNucleus enhancer already does with GAE/J)

 --

 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.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Dynamically create classes using JPA/JDO and bytecode instrumentation

2009-12-15 Thread Bombay Goose
Hello All,

I am doing a feasibility study of whether we can develop our application on
appengine or not.

Our application has a requirement where we have to create tables
dynamically, without restarting the application.

Is that possible in Appengine?

Datanucleus supports this through JDO, with some byte code instrumentation.
More info -
http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageId=6619188

Is it possible through JPA? if yes, does appengine allow it?
 if not, does Appengine allow Bytecode instrumentation so that we can
create classes dynamically according to the link above using JDO.

Any help is greatly appreciated.

Thanks,

G

--

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.