[appengine-java] Re: Entity relationship designing - best practice

2010-12-28 Thread marius.andreiana
On Dec 17, 8:43 pm, har_shan  wrote:
> i want to hear the best practice on establishing entity relationships in my
> case-
Does this help?
http://code.google.com/p/gwt-gae-book/wiki/StoringData

-- 
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: slf4j debug messages not in admin console

2010-12-28 Thread radomir
I use SLF4J bridged to java.util.logging and I receive debug messages
(using FINEST level in JUL config).



On Dec 25, 11:48 pm, Tomas Vojtech  wrote:
> Hello,
>
> I use SLF4J for logging and if I use logger.debug or logger.trace no
> message is shown in logs in administration console. Higher levels work
> fine and are in the console.
>
> Is problem in my application or where is problem?
>
> blaf

-- 
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] JPA query(JPQL) setFirstResult() and setMaxResult() does not work

2010-12-28 Thread Mike Guo
i'm sorry but what does "RCP" means?

-- 
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 injection" on App Engine ?

2010-12-28 Thread Fabrizio Accatino
Datanucleus,

perhaps my post was too impetuous. Sorry.
Actually "sql injection" (not real SQL) is a small issue on GAE. You are
right. GAE does not use SQL but you can "inject" piece of query into.

A very simple example:
String name = request.getParameter("name");
String q = "select from Employee where lastName == '" + name + "'";
Query query = pm.newQuery(Employee.class, q);

Case1 (good): send name = smith
Case2 (not good): send name = smith' || lastName == 'foo

OK. It's not so dangerous. Infact you cannot send strong injections like
"smith' || '1'=='1" because the engine (actually) refuse it.

So, you are right. No big problem.


   Fabrizio


On Mon, Dec 27, 2010 at 10:29 AM, datanucleus wrote:

> SQL injection ? into a database that doesn't support SQL? Please
> present a clear example of how such a thing can happen and what effect
> it can have. The application designer is the person who allows such a
> thing, not the underlying API
>
> --
> 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.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Instant messenger

2010-12-28 Thread Piyush Zarkar
Thanks Stevko for quick reply.
Your suggestions are really helpful to start with. 
I have decided to select servlets for writing code, GWT for creating GUI as 
you suggested.
But i am still confused how to authenticate google users , facebook users 
,yahoo users etc. Is there any authentication API ?
I am just collecting requirements at this moment. Once all the requirements 
freezes, i will start working on code and GUI. 
If you have any suggestion please let me know.
Hope you will help me.

-- 
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: "SQL injection" on App Engine ?

2010-12-28 Thread dreamer
The query language is more or less same for datastore as relational
db, so any thing could happen to relation db querying could
happen to datastore querying.

On Dec 27, 1:29 am, datanucleus  wrote:
> SQL injection ? into a database that doesn't support SQL? Please
> present a clear example of how such a thing can happen and what effect
> it can have. The application designer is the person who allows such a
> thing, not the underlying API

-- 
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] GWT+servlet - how to redirect to a different page

2010-12-28 Thread dreamer
Hi,

I have a GWT entry point that submits to servlet , build using
"FormPanel".
I am trying to build page flow using servlet "RequestDispatcher" or
"sendRedirect", even though no exception GAE is not forwarding to next
page.

-- 
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] Task Queue don't work in development server

2010-12-28 Thread l.denardo
Hello, I'm currently unable to use task queues on the development
server.
Both attempts to run mapreduce jobs and to check local admin console
at http://127.0.0.1:/_ah/admin/taskqueue give this error:

org.quartz.SchedulerConfigException: Unable to instantiate class
load helper class: org.quartz.simpl.CascadingClassLoadHelper cannot be
cast to org.quartz.spi.ClassLoadHelper [See nested exception:
java.lang.ClassCastException:
org.quartz.simpl.CascadingClassLoadHelper cannot be cast to
org.quartz.spi.ClassLoadHelper]

Caused by:

java.lang.RuntimeException: org.quartz.SchedulerConfigException:
Unable to instantiate class load helper class:
org.quartz.simpl.CascadingClassLoadHelper cannot be cast to
org.quartz.spi.ClassLoadHelper [See nested exception:
java.lang.ClassCastException:
org.quartz.simpl.CascadingClassLoadHelper cannot be cast to
org.quartz.spi.ClassLoadHelper]
at
com.google.appengine.api.taskqueue.dev.LocalTaskQueue.startScheduler(LocalTaskQueue.java:
433)
at
com.google.appengine.api.taskqueue.dev.LocalTaskQueue.start_(LocalTaskQueue.java:
194)
at com.google.appengine.api.taskqueue.dev.LocalTaskQueue.access
$000(LocalTaskQueue.java:49)
at com.google.appengine.api.taskqueue.dev.LocalTaskQueue
$2.run(LocalTaskQueue.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at
com.google.appengine.api.taskqueue.dev.LocalTaskQueue.start(LocalTaskQueue.java:
158)
at
com.google.appengine.tools.development.ApiProxyLocalImpl.startServices(ApiProxyLocalImpl.java:
466)
at com.google.appengine.tools.development.ApiProxyLocalImpl.access
$600(ApiProxyLocalImpl.java:44)
at com.google.appengine.tools.development.ApiProxyLocalImpl
$1.run(ApiProxyLocalImpl.java:448)
at com.google.appengine.tools.development.ApiProxyLocalImpl
$1.run(ApiProxyLocalImpl.java:446)
at java.security.AccessController.doPrivileged(Native Method)
at
com.google.appengine.tools.development.ApiProxyLocalImpl.getService(ApiProxyLocalImpl.java:
445)
at
com.google.apphosting.utils.servlet.TaskQueueViewerServlet.getLocalTaskQueueService(TaskQueueViewerServlet.java:
111)
at
com.google.apphosting.utils.servlet.TaskQueueViewerServlet.getQueueInfo(TaskQueueViewerServlet.java:
115)
at
com.google.apphosting.utils.servlet.TaskQueueViewerServlet.doGet(TaskQueueViewerServlet.java:
176)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
58)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
122)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:349)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.quartz.SchedulerConfigException: Unable to instantiate
class load helper class: org.quartz.simpl.CascadingClassLoadHelper
cannot be cas

[appengine-java] Re: Task Queue don't work in development server

2010-12-28 Thread l.denardo
Solved...just needed some more cleanup in the WEB_INF directory.

Removed appengine-testing.jar, appengine-api-labs.jar, appengine-api-
stubs.jar.
Moved them to test folder, added again to the classpath (maybe Eclipse
did not update build path correctly before...sometimes happens) to
make tests work, and it goes.

This is stated in the test suite documentation, maybe a line in the
development server section could help.

Regards
Lorenzo


On Dec 28, 12:13 pm, "l.denardo"  wrote:
> Hello, I'm currently unable to use task queues on the development
> server.
> Both attempts to run mapreduce jobs and to check local admin console
> athttp://127.0.0.1:/_ah/admin/taskqueuegive this error:
>
>     org.quartz.SchedulerConfigException: Unable to instantiate class
> load helper class: org.quartz.simpl.CascadingClassLoadHelper cannot be
> cast to org.quartz.spi.ClassLoadHelper [See nested exception:
> java.lang.ClassCastException:
> org.quartz.simpl.CascadingClassLoadHelper cannot be cast to
> org.quartz.spi.ClassLoadHelper]
>
> Caused by:
>
> java.lang.RuntimeException: org.quartz.SchedulerConfigException:
> Unable to instantiate class load helper class:
> org.quartz.simpl.CascadingClassLoadHelper cannot be cast to
> org.quartz.spi.ClassLoadHelper [See nested exception:
> java.lang.ClassCastException:
> org.quartz.simpl.CascadingClassLoadHelper cannot be cast to
> org.quartz.spi.ClassLoadHelper]
>         at
> com.google.appengine.api.taskqueue.dev.LocalTaskQueue.startScheduler(LocalTaskQueue.java:
> 433)
>         at
> com.google.appengine.api.taskqueue.dev.LocalTaskQueue.start_(LocalTaskQueue.java:
> 194)
>         at com.google.appengine.api.taskqueue.dev.LocalTaskQueue.access
> $000(LocalTaskQueue.java:49)
>         at com.google.appengine.api.taskqueue.dev.LocalTaskQueue
> $2.run(LocalTaskQueue.java:161)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> com.google.appengine.api.taskqueue.dev.LocalTaskQueue.start(LocalTaskQueue.java:
> 158)
>         at
> com.google.appengine.tools.development.ApiProxyLocalImpl.startServices(ApiProxyLocalImpl.java:
> 466)
>         at com.google.appengine.tools.development.ApiProxyLocalImpl.access
> $600(ApiProxyLocalImpl.java:44)
>         at com.google.appengine.tools.development.ApiProxyLocalImpl
> $1.run(ApiProxyLocalImpl.java:448)
>         at com.google.appengine.tools.development.ApiProxyLocalImpl
> $1.run(ApiProxyLocalImpl.java:446)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> com.google.appengine.tools.development.ApiProxyLocalImpl.getService(ApiProxyLocalImpl.java:
> 445)
>         at
> com.google.apphosting.utils.servlet.TaskQueueViewerServlet.getLocalTaskQueueService(TaskQueueViewerServlet.java:
> 111)
>         at
> com.google.apphosting.utils.servlet.TaskQueueViewerServlet.getQueueInfo(TaskQueueViewerServlet.java:
> 115)
>         at
> com.google.apphosting.utils.servlet.TaskQueueViewerServlet.doGet(TaskQueueViewerServlet.java:
> 176)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> 511)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1166)
>         at
> com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
> 58)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> 43)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
> 122)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> 388)
>         at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> 216)
>         at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> 182)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> 765)
>         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 418)
>         at
> com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
> 70)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>         at com.google.appengine.tools.development.JettyContainerService
> $ApiProxyHandler.handle(JettyContainerService.java:349)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>         at org.mortbay.jetty.Server.handle(Server.java:326)
>         at org.mortbay.jetty.HttpConnection.hand

[appengine-java] Re: GWT+servlet - how to redirect to a different page

2010-12-28 Thread dreamer
Instead of server dispatching/forwarding to a new page as in
traditional web flows,
I send the page name as response to BROWSER, and used GWT -
onSubmitComplete
event to go to new page.
== HERE CLIENT side code 
formPanel.addSubmitCompleteHandler(new
FormPanel.SubmitCompleteHandler() {
  public void onSubmitComplete(SubmitCompleteEvent event) {
  shownextpage("/page2.html");
  }
});
--
private native void shownextpage(String message) /*-{
$wnd.alert(message);
$wnd.location.href="/page2.html";
}-*/;
---

On Dec 28, 3:10 am, dreamer  wrote:
> Hi,
>
> I have a GWT entry point that submits to servlet , build using
> "FormPanel".
> I am trying to build page flow using servlet "RequestDispatcher" or
> "sendRedirect", even though no exception GAE is not forwarding to next
> page.

-- 
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] Instant messenger

2010-12-28 Thread A. Stevko
Hello Piyush,

re: Authentication and Authorization APIs
Every service has their own authentication API. Many are coming to use the
OAuth standard although I've not seen many successful integration efforts
yet.
http://code.google.com/appengine/docs/java/oauth/

There is google user
authentication support into the appengine platform with this package:
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/users/package-summary.html

The external services you are referring are out of the scope of this forum.
You might want to research them directly.
I've included some links to expedite your efforts.
http://code.google.com/apis/accounts/docs/GettingStarted.html
http://developers.facebook.com/docs/authentication/
http://developer.yahoo.com/auth/

Another resource that is is of broader scope and therefore more appropriate
for many the issues you are going to face is http://stackoverflow.com/

BTW, I'm open for hire presently...




On Tue, Dec 28, 2010 at 2:14 AM, Piyush Zarkar  wrote:

> Thanks Stevko for quick reply.
> Your suggestions are really helpful to start with.
> I have decided to select servlets for writing code, GWT for creating GUI as
> you suggested.
> But i am still confused how to authenticate google users , facebook users
> ,yahoo users etc. Is there any authentication API ?
> I am just collecting requirements at this moment. Once all the requirements
> freezes, i will start working on code and GUI.
> If you have any suggestion please let me know.
> Hope you will help me.
>
> --
> 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.
>



-- 
-- A. Stevko
===
"If everything seems under control, you're just not going fast enough." M.
Andretti

-- 
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: "SQL injection" on App Engine ?

2010-12-28 Thread datanucleus
> The query language is more or less same for datastore as relational
> db, so any thing could happen to relation db querying could
> happen to datastore querying.

Not true. JDOQL is parsed by a parser and converted into a datastore
query; SQL is not. JDOQL queries do not go there direct. The parsing
eliminates the vast majority of any evil intent. Not the same as
simply passing SQL direct through to a JDBC driver

-- 
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: in operator doesnt work

2010-12-28 Thread datanucleus
>  query = "select from " + PocVacationSchedule.class.getName() + " where
> pocId.contains(" + pocIdList + ")";
>
> where podIdList is a java.util.List of type Long

Now please tell me, in Java, would you do
"Long.contains(List)" ?
No. Thought not. On the other hand you would do
"List.contains(Long)"

-- 
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: Blob values in datastore and too many indexed properties

2010-12-28 Thread Ikai Lan (Google)
Cool. Thanks for the update!

--
Ikai Lan
Developer Programs Engineer, Google App Engine
Blogger: http://googleappengine.blogspot.com
Reddit: http://www.reddit.com/r/appengine
Twitter: http://twitter.com/app_engine



On Sun, Dec 26, 2010 at 1:48 AM, Sky wrote:

> I changed all List properties in my persistent class to
> double[] arrays and
> made these properties unindexed, because I never need to query on
> these.
> To make attributes unindexed I used the following annotation:
>
> @Extension(vendorName="datanucleus", key="gae.unindexed",
> value="true")//unindexed property
> private double[] listProperty;
>
> That fixed the problem and furthermore made the access faster...
>
> Marcus
>
>
>
>
> On 14 Dez., 20:03, "Ikai Lan (Google)" 
> 
> >
> wrote:
> > It's not an issue with the data type, it's an issue with queries that
> look
> > into multiple list properties:
> >
> > http://code.google.com/appengine/docs/java/datastore/queriesandindexe...
> >
> > What you have is an example of an exploding index. Rather than filtering
> in
> > query, is there any way you can filter for a subset of results using
> > datastore operations, then filter in memory?
> >
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
> > Blogger:http://googleappengine.blogspot.com
> > Reddit:http://www.reddit.com/r/appengine
> > Twitter:http://twitter.com/app_engine
> >
> > On Tue, Dec 14, 2010 at 3:35 AM, androidDeveloper <
> stepmas...@googlemail.com
> >
> > > wrote:
> > > I got an "IllegalArgumentException: Too many indexed properties for
> > > entity" Exception when saving an entity that looks like this:
> > >...
> > >@Persistent
> > >@Element(dependent = "true")
> > >@Order(extensions = @Extension(vendorName="datanucleus",
> key="list-
> > > ordering", value="aDate asc"))
> > >private List classAList;  //ClassA only contains basic
> > > properties like String and double
> >
> > >@Persistent
> > >private double[] list1;
> > >@Persistent
> > >private double[] list2;
> > >@Persistent
> > >private double[] list3;
> >
> > > When I save an object, that has no more than 10 objects in classAList
> > > and 3600 elements in each of the double[] Arrays list1-3 the error
> > > above occurs in datastore.
> > > I know that there exists a cap for indexed properties per entity of
> > > max 5000. But I though this would only affect list porperties?
> > > My question is, why are double arrays indexed? I thougt only List
> > > Properties would be indexed?
> > > Is double[] handled like List in app engines datastore?
> >
> > > --
> > > 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.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] query fails to parse

2010-12-28 Thread Ikai Lan (Google)
Taking a guess here - Date is being serialized to its String format. Try
programmatically creating filters instead:

http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html

--
Ikai Lan
Developer Programs Engineer, Google App Engine
Blogger: http://googleappengine.blogspot.com
Reddit: http://www.reddit.com/r/appengine
Twitter: http://twitter.com/app_engine



On Mon, Dec 27, 2010 at 7:08 AM, Vik  wrote:

> Hie
>
> Can someone guide what is the issue with this query and how to fix? data
> type is of java.sql.Date
>
>  Date todayDate = new Date();
>  query = "select from " + PocVacationSchedule.class.getName() + " where
> endDate >=" +  todayDate + " and pocId ==10";
>
>
> 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.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] GWT+servlet - how to redirect to a different page

2010-12-28 Thread Sumi
Did you try  Window.Location.assign(servelt name)


On Tue, Dec 28, 2010 at 3:10 AM, dreamer wrote:

> Hi,
>
> I have a GWT entry point that submits to servlet , build using
> "FormPanel".
> I am trying to build page flow using servlet "RequestDispatcher" or
> "sendRedirect", even though no exception GAE is not forwarding to next
> page.
>
> --
> 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.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Cloud2db for Cassandra and MongoDb

2010-12-28 Thread Sandeep Sathaye
Hi Everyone,

Cloud2db  is pleased to announce the support for
Cassandra and mongoDB cloud database platforms in addition to Google
Bigtable platform which it already supports. With this new release you will
be able to transparently choose between Google Bigtable, Cassandra and
MongoDB as your cloud database platform.

Please download the Cloud2db software from the following link.

Download (Google
Bigtable, Cassandra, MongoDB)

Cloud2db provides a standards-based abstraction layer over cloud databases.
This product provides you with performance and scalability of cloud platform
along with structure, standards and interoperability of RDBMS, SQL and JDBC.

With Cloud2db, you will be able to manage your data on cloud platforms by
using established concepts of RDBMS, SQL and JDBC, and thereby preserving
your existing investments in tools, technologies, frameworks and skills.

Here are Cloud2db features:

   - Manage data on Google Bigtable, Cassandra and MongoDB using familiar
   concepts of RDBMD, SQL
  - Referential integrity (Primary Keys, Foreign Keys)
  - Role Based Security
  - Joins (Inner Join, Left Outer Join, Theta Join, Cross Join)
  - Subqueries (Exists, Not Exists, In)
  - DDL & DML
  - Transactions (for the datastores supporting transactions)
  - ANSI SQL stored functions
  - Views
  - BLOB and CLOB support (for the datastores supporting BLOBs)


   - Use any JDBC compliant tools and frameworks in the market to interact
   with the Google Datastore. For example.
  - Squirrel SQL (database management)
  - Power Architect (data modeling)
  - Jasper Reports (reporting)
  - Hibernate (Object To Relational mapping)
  - All JDBC compliant tools


   - Port exiting RDBMS instances to cloud databases

Please visit our website http://www.cloud2db.com and try out the free trial
version. Please visit google group
Cloud2db to
share your feedback and thoughts.

Sincerely,

Sandeep Sathaye
Founder and Chief Architect
Cloud2db

-- 
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: Cloud2db for Cassandra and MongoDb

2010-12-28 Thread Daniel Florey
Hi,
this sounds very interesting.
Will the data stored in the db be human-readable in the datastore with
datastore viewer or will it just store a bunch of blobs?

Daniel

On Dec 28, 9:03 pm, Sandeep Sathaye  wrote:
> Hi Everyone,
>
> Cloud2db  is pleased to announce the support for
> Cassandra and mongoDB cloud database platforms in addition to Google
> Bigtable platform which it already supports. With this new release you will
> be able to transparently choose between Google Bigtable, Cassandra and
> MongoDB as your cloud database platform.
>
> Please download the Cloud2db software from the following link.
>
> Download (Google
> Bigtable, Cassandra, MongoDB)
>
> Cloud2db provides a standards-based abstraction layer over cloud databases.
> This product provides you with performance and scalability of cloud platform
> along with structure, standards and interoperability of RDBMS, SQL and JDBC.
>
> With Cloud2db, you will be able to manage your data on cloud platforms by
> using established concepts of RDBMS, SQL and JDBC, and thereby preserving
> your existing investments in tools, technologies, frameworks and skills.
>
> Here are Cloud2db features:
>
>    - Manage data on Google Bigtable, Cassandra and MongoDB using familiar
>    concepts of RDBMD, SQL
>       - Referential integrity (Primary Keys, Foreign Keys)
>       - Role Based Security
>       - Joins (Inner Join, Left Outer Join, Theta Join, Cross Join)
>       - Subqueries (Exists, Not Exists, In)
>       - DDL & DML
>       - Transactions (for the datastores supporting transactions)
>       - ANSI SQL stored functions
>       - Views
>       - BLOB and CLOB support (for the datastores supporting BLOBs)
>
>    - Use any JDBC compliant tools and frameworks in the market to interact
>    with the Google Datastore. For example.
>       - Squirrel SQL (database management)
>       - Power Architect (data modeling)
>       - Jasper Reports (reporting)
>       - Hibernate (Object To Relational mapping)
>       - All JDBC compliant tools
>
>    - Port exiting RDBMS instances to cloud databases
>
> Please visit our websitehttp://www.cloud2db.comand try out the free trial
> version. Please visit google group
> Cloud2db to
> share your feedback and thoughts.
>
> Sincerely,
>
> Sandeep Sathaye
> Founder and Chief Architect
> Cloud2db

-- 
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] GWT+servlet - how to redirect to a different page

2010-12-28 Thread Ikai Lan (Google)
You can't send a 302 to the client using sendRedirect(), since the client is
all JavaScript. As the earlier commenter says, you need to navigate using
JavaScript controls. You're probably better off writing a GWT RPC servlet
that returns a URL to redirect to, then using Window.Location() to navigate
to the new location.

--
Ikai Lan
Developer Programs Engineer, Google App Engine
Blogger: http://googleappengine.blogspot.com
Reddit: http://www.reddit.com/r/appengine
Twitter: http://twitter.com/app_engine



On Tue, Dec 28, 2010 at 11:50 AM, Sumi  wrote:

> Did you try  Window.Location.assign(servelt name)
>
>
>
> On Tue, Dec 28, 2010 at 3:10 AM, dreamer wrote:
>
>> Hi,
>>
>> I have a GWT entry point that submits to servlet , build using
>> "FormPanel".
>> I am trying to build page flow using servlet "RequestDispatcher" or
>> "sendRedirect", even though no exception GAE is not forwarding to next
>> page.
>>
>> --
>> 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.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] Re: Processing large xml-files with JAXB in app engine

2010-12-28 Thread androidDeveloper
I switched to javax.xml.parsers.SAXParser. The problem is now solved
and its obviously faster.
Performance JAXB (very large XML) ~ 4sec
SAXParser with specific optimizations ~ 0,35secs

Thanks for your help!

On 26 Dez., 21:03, dreamer  wrote:
> If the requirement is pure parsing and not the Marshalling and u-
> Marshalling from xml to objects, you may be better
> off using Stax or SAX parsers.
>
> On Dec 26, 4:29 am, Didier Durand  wrote:
>
> > Hi,
>
> > I don't need xsd and don't parse very large xml but the code is simple
> > to implement: so, unless you have a huge code base already working on
> > JAXB, you can probably write directly with the classes provided by GAE
>
> > It's hard for me to compare with jaxb that I didn't use that much.
>
> > The issue I see with JAXB and other external jars is that you need to
> > check their requirements againt the JRE list that I provided im my
> > previous post: you are never sure that the next version will require a
> > class unsupported by GAE.
>
> > regards
>
> > didier
>
> > On Dec 26, 11:44 am, androidDeveloper 
> > wrote:
>
> > > Hi,
>
> > > This approach would be my next choice. but implementing and testing
> > > this should be more complex as with JAXB?
>
> > > On 26 Dez., 08:54, Didier Durand  wrote:
>
> > > > Hi,
>
> > > > I use the xml parsing classes that are natively part of GAE JDK
> > > > itself : javax.xml.parsers.DocumentBuilder,
> > > > javax.xml.parsers.DocumentBuilderFactory, org.w3c.dom.Document, etc.
>
> > > > See bottom 
> > > > ofhttp://code.google.com/appengine/docs/java/jrewhitelist.html
>
> > > > Aren't those enough for what you want to achieve ?
>
> > > > regards
>
> > > > didier
>
> > > > On Dec 23, 6:54 pm, crllvnc  wrote:
>
> > > > > I've been using JAXB for xml file unmarshalling in an upload servlet.
> > > > > As far as I remember, the only size limit I have faced is related to
> > > > > the 30s timeout.
>
> > > > > Here are my imports :
> > > > > import javax.xml.bind.JAXBContext;
> > > > > import javax.xml.bind.JAXBElement;
> > > > > import javax.xml.bind.JAXBException;
> > > > > import javax.xml.bind.UnmarshalException;
> > > > > import javax.xml.bind.Unmarshaller;
>
> > > > > Maybe switching from JAXB2 to JAXB would solve (part of) your
> > > > > problems.
> > > > > Moreover, JAXB does not require any jar.
>
>

-- 
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] XMPP in dev mode

2010-12-28 Thread Eric Hubbard
Are there any plans to offer a seamless workaround for XMPP not working 
within dev mode?   I'm about to go fix-up/hack all my XMPP code so that when 
in developer mode I do polling & http ... but I'd much rather just stick to 
straight XMPP   

-- 
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] OAuth : Error 401:Invalid AuthSub token

2010-12-28 Thread Sumi
Error message
[WARN] Unable to respond to any of these challenges: {authsub=AuthSub
realm="http://www.google.com/accounts/AuthSubRequest"}
com.google.gdata.util.AuthenticationException: OK


Token invalid - Invalid AuthSub token.


Token invalid - Invalid AuthSub token.
Error 401



My code
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
oauthParameters.setScope("https://docs.google.com/feeds/";);
//

oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
  oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
  oauthParameters.setOAuthToken(orequest.getParameter("oauth_token"));
 oauthParameters.setOAuthTokenSecret(request.getParameter("oauth_verifier"));
DocsService client = new DocsService("goalcat-docs-v1");
  client.setOAuthCredentials(oauthParameters, signer);
  URL feedUrl = new URL("https://docs.google.com/feeds/default/private/full
");
  *DocumentListFeed resultFeed = client.getFeed(feedUrl,
DocumentListFeed.class);*

-- 
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] Always on instance startup delay with only two concurrent requests

2010-12-28 Thread John
After configuring my app with 'always on', I still see some long delays with 
log entries indicating a new process is being started. There is at least on 
occurrence where there hadn't been any requests for about 60 seconds and 
then two requests arrived within 300 ms. The first request got a fully 
warmed instance and completed in 332 ms (according to the log).  The second 
request caused a new instance startup and took 6181 ms to complete (enough 
time to serve about 9 requests).  With 'always on' configured, I would 
expect an instance to be available for the second request. I wonder if 
there's any way to know why GAE didn't have an available instance to handle 
the second request - is there something I can do?

-- 
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] Using entity.setProperty on one-to-many relationships

2010-12-28 Thread Kalyan Akella
Hi,

In my application, I have the following unidirectional one-to-many 
relationship:

@PersistenceCapable
public class Recipe implements Serializable {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private String name;

}

@PersistenceCapable
public class CookBook {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private String title;

@Persistent
private List recipes;// *<- one to many with Recipe *

}

I am doing the following to persist an instance of *CookBook* into data 
store using the low level API:

private DatastoreService dataStoreSvc = 
DatastoreServiceFactory.getDatastoreService();

public void persistEntity(CookBook cookBook) {
Entity entityToPersist = new Entity("CookBook");
...
entityToPersist.setProperty("recipes", cookBook.getRecipes());  // *<-- 
an error occurs here*
...
dataStoreSvc.put(entityToPersist);
}

In the snippet above, the highlighted line throws the following error:

recipes: com.examples.domain.Recipe is not a supported property type.
java.lang.IllegalArgumentException: recipes: com.examples.domain.Recipe is 
not a supported property type.
at 
com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184)
at 
com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:149)
at 
com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:123)
at 
com.google.appengine.api.datastore.Entity.setProperty(Entity.java:280)
at 
com.examples.domain.persist.DatastoreHelper.persistEntity(DatastoreHelper.java:21)

Note that I marked the *Recipe* class to be Serializable & 
PersistanceCapable. Still the *setProperty* call fails. Moreover, I am using 
this snippet of code (and the low level API) during local unit testing and 
my test fails with this error.

Could you please help me understand what am I missing here ? Please let me 
know if you need more information.
Sincere Regards,
Kalyan

-- 
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] persistent and scalable global atomic counter: not possible with GAE?

2010-12-28 Thread MG
Hello!

I need to create a global atomic counter (64-bit) in my AppEngine/J
app. Like

long count = MyCounter.increment()

that will 100% guarantee that count will never ever be the same for
two different requests, and that I will be able to increment it
several million times/day initially, and much more if/when traffic
increases. I do not really care if it skips a number or two
occasionally: I can live with it returning a value larger than the
actual number of calls, but I do need absolute uniqueness and
reasonably linear growth (i.e. is two consecutive calls from a client
should result in ascending counter values).

Is this possible to do with Google AppEngine? Sharded counters can
ensure consistent counting, but not unique counts; memcache counters
can ensure unique increments, but they are perishable and thus
difficult (impossible?) to properly synchronize with persistent
storage. Using one entity to read-update in a transaction will not
scale...

Thanks,
MG

-- 
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: persistent and scalable global atomic counter: not possible with GAE?

2010-12-28 Thread nischalshetty
Have a look at the Datastore "Key" thingy. The keys generated are
unique across the system IMO. Not sure though but that's what I
remember reading somewhere.

-N

On Dec 29, 7:43 am, MG  wrote:
> Hello!
>
> I need to create a global atomic counter (64-bit) in my AppEngine/J
> app. Like
>
> long count = MyCounter.increment()
>
> that will 100% guarantee that count will never ever be the same for
> two different requests, and that I will be able to increment it
> several million times/day initially, and much more if/when traffic
> increases. I do not really care if it skips a number or two
> occasionally: I can live with it returning a value larger than the
> actual number of calls, but I do need absolute uniqueness and
> reasonably linear growth (i.e. is two consecutive calls from a client
> should result in ascending counter values).
>
> Is this possible to do with Google AppEngine? Sharded counters can
> ensure consistent counting, but not unique counts; memcache counters
> can ensure unique increments, but they are perishable and thus
> difficult (impossible?) to properly synchronize with persistent
> storage. Using one entity to read-update in a transaction will not
> scale...
>
> Thanks,
> MG

-- 
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: persistent and scalable global atomic counter: not possible with GAE?

2010-12-28 Thread MG
Yes, keys are unique, but they are strings, and quite long (20+
characters, from what I've seen). I do need unique and "growing"
numeric counter.

On Dec 28, 11:20 pm, nischalshetty  wrote:
> Have a look at the Datastore "Key" thingy. The keys generated are
> unique across the system IMO. Not sure though but that's what I
> remember reading somewhere.
>
> -N
>
> On Dec 29, 7:43 am, MG  wrote:
>
>
>
>
>
>
>
> > Hello!
>
> > I need to create a global atomic counter (64-bit) in my AppEngine/J
> > app. Like
>
> > long count = MyCounter.increment()
>
> > that will 100% guarantee that count will never ever be the same for
> > two different requests, and that I will be able to increment it
> > several million times/day initially, and much more if/when traffic
> > increases. I do not really care if it skips a number or two
> > occasionally: I can live with it returning a value larger than the
> > actual number of calls, but I do need absolute uniqueness and
> > reasonably linear growth (i.e. is two consecutive calls from a client
> > should result in ascending counter values).
>
> > Is this possible to do with Google AppEngine? Sharded counters can
> > ensure consistent counting, but not unique counts; memcache counters
> > can ensure unique increments, but they are perishable and thus
> > difficult (impossible?) to properly synchronize with persistent
> > storage. Using one entity to read-update in a transaction will not
> > scale...
>
> > Thanks,
> > MG

-- 
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: in operator doesnt work

2010-12-28 Thread Vik
Hie thanks that was a silly mistake...

However, then how to write the JDOQL for this case?

I have a list of  long values and i need to find only those rows which has
one of the long value in that attribute.

In typical sql i will write it as:

select * from mytable where  pocId IN (1,3,5)

where 1,3,5 is a list of long values.

Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Tue, Dec 28, 2010 at 1:58 PM, datanucleus wrote:

> >  query = "select from " + PocVacationSchedule.class.getName() + " where
> > pocId.contains(" + pocIdList + ")";
> >
> > where podIdList is a java.util.List of type Long
>
> Now please tell me, in Java, would you do
> "Long.contains(List)" ?
> No. Thought not. On the other hand you would do
> "List.contains(Long)"
>
> --
> 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.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Using entity.setProperty on one-to-many relationships

2010-12-28 Thread Didier Durand
Hi,

I think we need to know your class "Entity" to spot the problem

regards

didier

On Dec 29, 1:57 am, Kalyan Akella  wrote:
> Hi,
>
> In my application, I have the following unidirectional one-to-many
> relationship:
>
> @PersistenceCapable
> public class Recipe implements Serializable {
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key key;
>
>     @Persistent
>     private String name;
>     
>
> }
>
> @PersistenceCapable
> public class CookBook {
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key key;
>
>     @Persistent
>     private String title;
>
>     @Persistent
>     private List recipes;    // *<- one to many with Recipe *
>     
>
> }
>
> I am doing the following to persist an instance of *CookBook* into data
> store using the low level API:
>
>     private DatastoreService dataStoreSvc =
> DatastoreServiceFactory.getDatastoreService();
>
>     public void persistEntity(CookBook cookBook) {
>         Entity entityToPersist = new Entity("CookBook");
>         ...
>         entityToPersist.setProperty("recipes", cookBook.getRecipes());  // 
> *<--
> an error occurs here*
>         ...
>         dataStoreSvc.put(entityToPersist);
>     }
>
> In the snippet above, the highlighted line throws the following error:
>
> recipes: com.examples.domain.Recipe is not a supported property type.
> java.lang.IllegalArgumentException: recipes: com.examples.domain.Recipe is
> not a supported property type.
>     at
> com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184)
>     at
> com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:149)
>     at
> com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:123)
>     at
> com.google.appengine.api.datastore.Entity.setProperty(Entity.java:280)
>     at
> com.examples.domain.persist.DatastoreHelper.persistEntity(DatastoreHelper.java:21)
>
> Note that I marked the *Recipe* class to be Serializable &
> PersistanceCapable. Still the *setProperty* call fails. Moreover, I am using
> this snippet of code (and the low level API) during local unit testing and
> my test fails with this error.
>
> Could you please help me understand what am I missing here ? Please let me
> know if you need more information.
> Sincere Regards,
> Kalyan

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