[appengine-java] Re: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread Mingfai
imho, the low level api is quite simple and straightforward. The relevant
docs for Python is useful to me.

there is nothing wrong with JPA/JDO. DAO + Low Level API implementation
without an additional JDO layer works for me.


On Thu, Sep 24, 2009 at 5:23 AM, Marcel Overdijk
wrote:

>
> I think the docs about low level api is rather limited. Some examples
> would be nice.
>
> On Sep 23, 4:33 pm, Clay Lenhart  wrote:
> > +1
> >
> > We're having a similar discussion here:
> >
> > http://groups.google.com/group/google-appengine-java/browse_thread/th...
> >
> > Andy,
> > My view is that there is no productivity difference between the two.
> >
> > It might be good to show us what is difficult to do in the datastore
> > but easy in JDO.
> >
> > Cheers,
> > Clay
> >
> > On Sep 23, 11:02 am, datanucleus  wrote:
> >
> >
> >
> > > > BigTable simply is not a relational db, so it is highly misleading to
> > > > fake a relational wrapper and to me it caused lots of pain.
> >
> > > Apart from the fact that JDO is not a "relational wrapper". The API
> > > and metadata are object-based; only a subset of metadata is specific
> > > to "mapped" datastores and this is marked clearly in the (DataNucleus)
> > > docs.
> >
> > > As ever, if you have some specific issue to raise why not define it -
> > > e.g something that can be done in the low level API that can't be done
> > > via a generic 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-java@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: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread Marcel Overdijk

@Diana

Currently there is only "real" docs for JDO.
I think same documentation should be available for JPA and low-level
API.
Concentrating on practical exmaples.

On Sep 24, 7:09 am, Diana Cruise  wrote:
> Could you supply some briefs on your findings?  This is exactly the
> type of feedback we need in this forum to help us who are starting new
> projects to best decide on what APIs and designs to use.
>
> For example, if you could summarize your handling of this simple
> relation that is in ALL apps:  Entity A and B are related to each
> other via C.  So, A is 1-many with C and B is 1-many with C...so C is
> a many-to-many.  Surely, you have this in your app.  How do you
> compare your JDO implementation of these 3 Entities with your low-
> level API implementation?  Perhaps you could include some simple code
> to illustrate your points.
>
> Seems I've only seen very basic examples like Hello World.  Really,
> nothing beyond 1 relation...which is very limited and thus, ALL THE
> PERSISTENCE CONFUSION around here...
>
> Thanks.
>
> On Sep 23, 4:40 am, dflorey  wrote:
>
>
>
> > I've just refactored my app to use Low-Level API instead of JDO and
> > it's much cleaner, works more reliable etc.
> > If you are not really forced to use JDO/JPA I'd strongly recommend to
> > use the very simple, elegant and clean Low-Level API.
> > BigTable simply is not a relational db, so it is highly misleading to
> > fake a relational wrapper and to me it caused lots of pain.
--~--~-~--~~~---~--~~
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-java@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: How to store tree ? example?

2009-09-23 Thread Ian Marshall

My persistent entity class is only written to datastore by an
administrator user, and the writes are very infrequent, so I cannot
comment on any performance issues when writing large volumes to the
datastore.

My class above has BigTable generate the Long ID for each entity,
since I cannot be bothered to do so in my app!

Cheers,

Ian
--~--~-~--~~~---~--~~
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-java@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: Seeing different (incorrect?) JDO behavior after upgrading to 1.2.5

2009-09-23 Thread Ian Marshall

Oh dear, sorry that didn't work.

All I can say is that you are very brave to set the encodedKey values
in your code. I let BigTable do this for me (and correctly, I hope)!
--~--~-~--~~~---~--~~
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-java@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: PDF Generator Library

2009-09-23 Thread Mian Rashid

Use can use Jasper Report and there is also designer tool available
for that is IReport.

On Sep 23, 6:57 pm, mably  wrote:
> Does anybody know of a java PDF generator library working with Google
> App Engine ?  Even a low-level one.
>
> Any help would be greatly appreciated.
>
> Thanx in advance.
>
> Francois
> Bordeaux, FRANCE
--~--~-~--~~~---~--~~
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-java@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: Type Owned by Two Different Types?

2009-09-23 Thread Diana Cruise

It seems alarming to me that these basic relations are difficult to
code.  Lets face it, applications are full of these relations...it
seems to me that too much developer time is required in the
Persistence layer of GAE apps.  The Persistence and Presentation
layers needs to be a "no brainer", so more focus can be where it needs
to be - the business layer.  Does anyone feel the same?

On Sep 23, 7:51 pm, objectuser  wrote:
> Here's some code that reproduces my problem.  Before the code, I think
> it's interesting to note that I started making this example in JPA
> (because I had an old test that used JPA) and I was not able to
> reproduce the error.  However, after converting to JDO, I get the
> error.  I'm not 100% sure the code is exactly the same, however, but
> wanted to note it in case it's helpful to anyone.
>
> LocalServiceTestCase is based on the examples from Google.
>
> Does anyone see a problem with the code or is this a legit bug?
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION,
> detachable = "true")
> public class ParentOfOne {
>
>         @PrimaryKey
>         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         private Long id;
>
>         @Persistent
>         private SharedChild child;
>         ...
>
> }
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION,
> detachable = "true")
> public class ParentOfList {
>
>         @PrimaryKey
>         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         private Long id;
>
>         @Persistent
>         private List children;
>         ...
>
> }
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION,
> detachable = "true")
> public class SharedChild {
>
>         @PrimaryKey
>         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         private Key id;
>
>         @Persistent
>         private String name;
>         ...
>
> }
>
> public class SharedChildTestCase extends LocalServiceTestCase {
>
>         private PersistenceManager persistenceManager;
>
>         @Before
>         public void openPersistenceManager() {
>                 PersistenceManagerFactory persistenceManagerFactory = 
> JDOHelper
>                                 
> .getPersistenceManagerFactory("transactions-optional");
>                 persistenceManager = 
> persistenceManagerFactory.getPersistenceManager
> ();
>         }
>
>         @After
>         public void closePersitenceManager() {
>                 persistenceManager.close();
>         }
>
>         @Test
>         public void saveParents() {
>                 ParentOfList pol = new ParentOfList();
>                 List list = new ArrayList();
>                 SharedChild c1 = new SharedChild();
>                 c1.setName("c1");
>                 list.add(c1);
>                 SharedChild c2 = new SharedChild();
>                 c2.setName("c2");
>                 list.add(c2);
>                 pol.setChildren(list);
>                 persistenceManager.makePersistent(pol);
>
>                 ParentOfOne poo = new ParentOfOne();
>                 SharedChild c3 = new SharedChild();
>                 c1.setName("c3");
>                 poo.setChild(c3);
>                 persistenceManager.makePersistent(poo);
>         }
>
> }
>
> On Sep 22, 9:40 am, objectuser  wrote:
>
>
>
> > Thanks, Marton.  That's very unfortunate.  The limitations still
> > surprise me.  Is that documented somewhere?  Need to go back and
> > reread that stuff I guess.
>
> > I'll see if I can come up with a simple test case for the collection.
>
> > On Sep 22, 3:28 am, Marton Papp  wrote:
>
> > > A class cannot have two different owned relationship to a single
> > > class. For example if I have these two classes:
>
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > > public class Parent3 {
>
> > >         @PrimaryKey
> > >         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >         private Long id;
>
> > >         Child1 child1;
>
> > >         Child1 child2;
>
> > > // ... get-set
>
> > > }
>
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > > public class Child1 {
>
> > >     @PrimaryKey
> > >     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >     private Key id;
>
> > > // ... get-set
>
> > > }
>
> > > then this code will fail with an assertion error:
>
> > >         public void testMultiParent2() throws Exception {
>
> > >                 PersistenceManager pm;
>
> > >                 Parent3 p3 = null;
> > >                 Parent3 p3Loaded = null;
>
> > >                 pm = pmf.getPersistenceManager();
> > >                 pm.currentTransaction().begin();
>
> > >                 p3 = new Parent3();
> > >                 p3.setChild1(new Child1());
> > >                 p3.setChild2(new Child1());
> > >                 pm.makePersistent(p3);
> > >                 pm.currentTransaction().commit();
> > >                 pm.close();
>
> > >                 pm = pmf.getPe

[appengine-java] Re: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread Diana Cruise

Could you supply some briefs on your findings?  This is exactly the
type of feedback we need in this forum to help us who are starting new
projects to best decide on what APIs and designs to use.

For example, if you could summarize your handling of this simple
relation that is in ALL apps:  Entity A and B are related to each
other via C.  So, A is 1-many with C and B is 1-many with C...so C is
a many-to-many.  Surely, you have this in your app.  How do you
compare your JDO implementation of these 3 Entities with your low-
level API implementation?  Perhaps you could include some simple code
to illustrate your points.

Seems I've only seen very basic examples like Hello World.  Really,
nothing beyond 1 relation...which is very limited and thus, ALL THE
PERSISTENCE CONFUSION around here...

Thanks.

On Sep 23, 4:40 am, dflorey  wrote:
> I've just refactored my app to use Low-Level API instead of JDO and
> it's much cleaner, works more reliable etc.
> If you are not really forced to use JDO/JPA I'd strongly recommend to
> use the very simple, elegant and clean Low-Level API.
> BigTable simply is not a relational db, so it is highly misleading to
> fake a relational wrapper and to me it caused lots of pain.
--~--~-~--~~~---~--~~
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-java@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: Best practice for modeling relationships (Java, Datastore) - list of keys or list of actual objects?!

2009-09-23 Thread objectuser

Well, yeah, it depends on the questions you want to ask the datastore
and what you're going to do with that data.  If your list is large, do
you always want to fetch the whole thing together anyway?  Then an
owned relationship might be fine (but note the entity fetch limit).

Do you want to fetch things in smaller pieces?  Then the model
recommended by Ieszek is probably going to serve you better.

I recommend reading about entities and entity groups and then the
articles about performance and modeling.  There's a lot there that's
relevant.

On Sep 22, 8:00 am, Andreas Kristensson
 wrote:
> My thinking as well.
>
> However, looking at GAE Java examples, tutorials, articles, etc, it's
> often the other way around - i.e. keeping lists with referenced
> objects... Might be that those examples outline one-to-few
> relationships where it's (for some reason?! simpler?!) ok to have
> lists of referenced objects instead of lists of keys to referenced
> objects.
>
> On Sep 22, 2:46 pm, leszek  wrote:
>
> > Much better is to keep List than retrieve Pictures on demand
> > ('paging' them) using 'batch gets' :
>
> >http://groups.google.co.uk/group/google-appengine-java/browse_frm/thr...
--~--~-~--~~~---~--~~
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-java@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: will it make any difference if i do not provide a separate class (PMF) for PersistentManagerFactory

2009-09-23 Thread objectuser

I think the key is to not create them all the time.  So don't make a
new one for each transaction.  Make one and keep it around.

On Sep 23, 10:19 am, Prashant  wrote:
> Hi,
>
> Will it make any difference to the performance of the app if I do not write
> a separate class (PMF, as suggested in GAE docs) for getting
> PersistentManagerFactory instance, instead, I declare it as a variable in
> the class where I want to use it, like
>
> protected final PersistenceManagerFactory pmf     =
> JDOHelper.getPersistenceManagerFactory("transactions-optional");
>
> // NOTE: I am not using *static* keyword.
>
> 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-java@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(defaultFetchGroup="false")

2009-09-23 Thread objectuser

You can use a named fetch group.  See the Datanucleus docs, but
they're pretty easy to use.

On Sep 23, 3:47 pm, Max  wrote:
> How do I fetch field that is not declared like:-
>
>         @Persistent(defaultFetchGroup="true")
>
> I am using JDO
>
> Thanks, Max
--~--~-~--~~~---~--~~
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-java@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: Extra log output

2009-09-23 Thread Vatsa

Hi Pion,
  Can you please explain how to use BasicConfigurator.configure();
Can I have something like a -Dlog4j.configuration=file:$log4jfile \

log4file is the actual log4j.properties file

Thanks
Vatsa


On Sep 23, 3:05 pm, Toby Reyelts  wrote:
> On Wed, Sep 23, 2009 at 5:39 PM, Pion  wrote:
>
> > Thanks for your reply, Toby.
>
> > I am using log4j because I want to be consistent with some existing
> > modules/classes. I did the following:
>
> >          import org.apache.log4j.Logger;
>
> Whoops, saw the code and immediately thought it was using java.util.logging.
>
>
>
> > I just saw
> >http://logging.apache.org/log4j/1.2/faq.html#duplicate-messages.
> > log4jcall
> >  is cumulative/additive. I called the
> > BasicConfigurator.configure(); methods more than once. Now it is
> > fixed.
>
> Glad to see you solved the problem.
>
>
>
> > Again, thanks.
>
> > On Sep 23, 2:20 pm, Toby Reyelts  wrote:
> > > You're using java.util.logging, not log4j. What does your
> > logging.properties
> > > file look like?
>
> > > On Wed, Sep 23, 2009 at 5:02 PM, Pion  wrote:
>
> > > > I have the following code snippet:
>
> > > > public class FooServiceImpl extends RemoteServiceServlet implements
> > > > ControllerInputService {
>
> > > >       �...@override
> > > >     public String bar(String input) {
> > > >          ...
> > > >          logger.debug("Entering ... bar()");
> > > >         ...
> > > >     }
>
> > > >        private static final Logger logger = Logger.getLogger
> > > > (FooServiceImpl .class.getName());
> > > > } // FooServiceImpl
>
> > > > It prints out the following messages:
>
> > > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> > > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> > > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
>
> > > > Notice that it prints out more than 1 time. I double/triple checked
> > > > that I only call the bar() method once.
>
> > > > Then, I modified the code as the following:
>
> > > > public class FooServiceImpl extends RemoteServiceServlet implements
> > > > ControllerInputService {
>
> > > >       �...@override
> > > >     public String bar(String input) {
> > > >          ...
> > > >          counter++;
> > > >          logger.debug(counter + " Entering ... bar()");
> > > >          System.out.println(counter + " Entering ... bar() from
> > > > System.out.println()");
> > > >         ...
> > > >     }
>
> > > >        private int counter = 0;
>
> > > >        private static final Logger logger = Logger.getLogger
> > > > (FooServiceImpl .class.getName());
> > > > } // FooServiceImpl
>
> > > > It produces the following output:
>
> > > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > > > ()
> > > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > > > ()
> > > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > > > ()
> > > > 1 Entering ... bar() from System.out.println()
>
> > > > Notice that there are still several log outputs (not as expected - I
> > > > only expect only 1 output) but only one output from System.out.println
> > > > () (as expected) and the counter is still 1 (as expected).
>
> > > > My log4j.properties
>
> > > > # A default log4j configuration for log4j users.
> > > > #
> > > > # To use this configuration, deploy it into your application's WEB-INF/
> > > > classes
> > > > # directory.  You are also encouraged to edit it as you like.
>
> > > > # Configure the console as our one appender
> > > > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> > > > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > > > log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c]
> > > > - %m%n
>
> > > > My environtments: GAE 1.2.5, GWT 1.7, Eclipse-Galileo on Windows
> > > > Vista.
>
> > > > Why do I have several log output?
>
> > > > Thanks in advance for your help.
--~--~-~--~~~---~--~~
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-java@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: Type Owned by Two Different Types?

2009-09-23 Thread objectuser

Here's some code that reproduces my problem.  Before the code, I think
it's interesting to note that I started making this example in JPA
(because I had an old test that used JPA) and I was not able to
reproduce the error.  However, after converting to JDO, I get the
error.  I'm not 100% sure the code is exactly the same, however, but
wanted to note it in case it's helpful to anyone.

LocalServiceTestCase is based on the examples from Google.

Does anyone see a problem with the code or is this a legit bug?

@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable = "true")
public class ParentOfOne {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;

@Persistent
private SharedChild child;
...
}

@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable = "true")
public class ParentOfList {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;

@Persistent
private List children;
...
}

@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable = "true")
public class SharedChild {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;

@Persistent
private String name;
...
}

public class SharedChildTestCase extends LocalServiceTestCase {

private PersistenceManager persistenceManager;

@Before
public void openPersistenceManager() {
PersistenceManagerFactory persistenceManagerFactory = JDOHelper

.getPersistenceManagerFactory("transactions-optional");
persistenceManager = 
persistenceManagerFactory.getPersistenceManager
();
}

@After
public void closePersitenceManager() {
persistenceManager.close();
}

@Test
public void saveParents() {
ParentOfList pol = new ParentOfList();
List list = new ArrayList();
SharedChild c1 = new SharedChild();
c1.setName("c1");
list.add(c1);
SharedChild c2 = new SharedChild();
c2.setName("c2");
list.add(c2);
pol.setChildren(list);
persistenceManager.makePersistent(pol);

ParentOfOne poo = new ParentOfOne();
SharedChild c3 = new SharedChild();
c1.setName("c3");
poo.setChild(c3);
persistenceManager.makePersistent(poo);
}
}

On Sep 22, 9:40 am, objectuser  wrote:
> Thanks, Marton.  That's very unfortunate.  The limitations still
> surprise me.  Is that documented somewhere?  Need to go back and
> reread that stuff I guess.
>
> I'll see if I can come up with a simple test case for the collection.
>
> On Sep 22, 3:28 am, Marton Papp  wrote:
>
> > A class cannot have two different owned relationship to a single
> > class. For example if I have these two classes:
>
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > public class Parent3 {
>
> >         @PrimaryKey
> >         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >         private Long id;
>
> >         Child1 child1;
>
> >         Child1 child2;
>
> > // ... get-set
>
> > }
>
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > public class Child1 {
>
> >     @PrimaryKey
> >     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >     private Key id;
>
> > // ... get-set
>
> > }
>
> > then this code will fail with an assertion error:
>
> >         public void testMultiParent2() throws Exception {
>
> >                 PersistenceManager pm;
>
> >                 Parent3 p3 = null;
> >                 Parent3 p3Loaded = null;
>
> >                 pm = pmf.getPersistenceManager();
> >                 pm.currentTransaction().begin();
>
> >                 p3 = new Parent3();
> >                 p3.setChild1(new Child1());
> >                 p3.setChild2(new Child1());
> >                 pm.makePersistent(p3);
> >                 pm.currentTransaction().commit();
> >                 pm.close();
>
> >                 pm = pmf.getPersistenceManager();
> >                 pm.currentTransaction().begin();
>
> >                 p3Loaded = pm.getObjectById(Parent3.class, p3.getId());
>
> >                 Assert.assertNotSame(p3Loaded.getChild1(), 
> > p3Loaded.getChild2());
>
> >                 pm.currentTransaction().commit();
> >                 pm.close();
>
> >         }
>
> > It is because the datastore represents the relationship between Child1
> > and Parent3 instances by making the Parent3 instance the parent of the
> > Child1 instance. And it does the same for both Parent3.child1 and
> > Parent3.child2 relationships, so there is no way to tell which
> > property a particular instance of Child1 

[appengine-java] javax.jdo.JDOFatalUserException

2009-09-23 Thread Vatsa

Hi,
  I am a newbie to "Google App Engine".  We are trying to prototype a
simple application to persist DTO which are read from a .csv file to
the virtual data store.

  I get the following error (very descriptive) at the time of
instantiating the Access Manager

Caused by: javax.jdo.JDOFatalUserException: Application code attempted
to create a PersistenceManagerFactory named transactions-optional, but
one with this name already exists!  Instances of
PersistenceManagerFactory are extremely slow to create and it is
usually not necessary to create one with a given name more than once.
Instead, create a singleton and share it throughout your code.  If you
really do need to create a duplicate PersistenceManagerFactory (such
as for a unittest suite), set the
appengine.orm.disable.duplicate.pmf.exception system property to avoid
this error.


Thanks
Vatsa
--~--~-~--~~~---~--~~
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-java@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: Java Low Level commit timeout

2009-09-23 Thread Jason (Google)
Hi Tim. Yes, if the entities are in distinct entity groups, then they will
be written in parallel.

- Jason

On Tue, Sep 22, 2009 at 8:03 AM, ted stockwell  wrote:

>
>
>
> On Sep 21, 1:07 pm, "Jason (Google)"  wrote:
> > Since bulk updates to entities in the
> > same group are performed sequentially and not in parallel
> >
> > - Jason
> >
>
> Hi Jason,
>
> Question...  If I do a bulk put where the entities are NOT in the same
> entity group then would the updates be performed in parallel??
>
> I ask because I could put a parallel put to good use in some
> situations
> >
>

--~--~-~--~~~---~--~~
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-java@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: Extra log output

2009-09-23 Thread Toby Reyelts
On Wed, Sep 23, 2009 at 5:39 PM, Pion  wrote:

>
> Thanks for your reply, Toby.
>
> I am using log4j because I want to be consistent with some existing
> modules/classes. I did the following:
>
>  import org.apache.log4j.Logger;
>

Whoops, saw the code and immediately thought it was using java.util.logging.


>
> I just saw
> http://logging.apache.org/log4j/1.2/faq.html#duplicate-messages.
> log4jcall
>  is cumulative/additive. I called the
> BasicConfigurator.configure(); methods more than once. Now it is
> fixed.
>

Glad to see you solved the problem.


>
> Again, thanks.
>
> On Sep 23, 2:20 pm, Toby Reyelts  wrote:
> > You're using java.util.logging, not log4j. What does your
> logging.properties
> > file look like?
> >
> > On Wed, Sep 23, 2009 at 5:02 PM, Pion  wrote:
> >
> > > I have the following code snippet:
> >
> > > public class FooServiceImpl extends RemoteServiceServlet implements
> > > ControllerInputService {
> >
> > >@Override
> > > public String bar(String input) {
> > >  ...
> > >  logger.debug("Entering ... bar()");
> > > ...
> > > }
> >
> > >private static final Logger logger = Logger.getLogger
> > > (FooServiceImpl .class.getName());
> > > } // FooServiceImpl
> >
> > > It prints out the following messages:
> >
> > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> >
> > > Notice that it prints out more than 1 time. I double/triple checked
> > > that I only call the bar() method once.
> >
> > > Then, I modified the code as the following:
> >
> > > public class FooServiceImpl extends RemoteServiceServlet implements
> > > ControllerInputService {
> >
> > >@Override
> > > public String bar(String input) {
> > >  ...
> > >  counter++;
> > >  logger.debug(counter + " Entering ... bar()");
> > >  System.out.println(counter + " Entering ... bar() from
> > > System.out.println()");
> > > ...
> > > }
> >
> > >private int counter = 0;
> >
> > >private static final Logger logger = Logger.getLogger
> > > (FooServiceImpl .class.getName());
> > > } // FooServiceImpl
> >
> > > It produces the following output:
> >
> > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > > ()
> > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > > ()
> > > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > > ()
> > > 1 Entering ... bar() from System.out.println()
> >
> > > Notice that there are still several log outputs (not as expected - I
> > > only expect only 1 output) but only one output from System.out.println
> > > () (as expected) and the counter is still 1 (as expected).
> >
> > > My log4j.properties
> >
> > > # A default log4j configuration for log4j users.
> > > #
> > > # To use this configuration, deploy it into your application's WEB-INF/
> > > classes
> > > # directory.  You are also encouraged to edit it as you like.
> >
> > > # Configure the console as our one appender
> > > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> > > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > > log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c]
> > > - %m%n
> >
> > > My environtments: GAE 1.2.5, GWT 1.7, Eclipse-Galileo on Windows
> > > Vista.
> >
> > > Why do I have several log output?
> >
> > > Thanks in advance for your help.
> >
>

--~--~-~--~~~---~--~~
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-java@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: Extra log output

2009-09-23 Thread Pion

Thanks for your reply, Toby.

I am using log4j because I want to be consistent with some existing
modules/classes. I did the following:

  import org.apache.log4j.Logger;

I just saw http://logging.apache.org/log4j/1.2/faq.html#duplicate-messages.
log4j call is cumulative/additive. I called the
BasicConfigurator.configure(); methods more than once. Now it is
fixed.

Again, thanks.

On Sep 23, 2:20 pm, Toby Reyelts  wrote:
> You're using java.util.logging, not log4j. What does your logging.properties
> file look like?
>
> On Wed, Sep 23, 2009 at 5:02 PM, Pion  wrote:
>
> > I have the following code snippet:
>
> > public class FooServiceImpl extends RemoteServiceServlet implements
> > ControllerInputService {
>
> >       �...@override
> >     public String bar(String input) {
> >          ...
> >          logger.debug("Entering ... bar()");
> >         ...
> >     }
>
> >        private static final Logger logger = Logger.getLogger
> > (FooServiceImpl .class.getName());
> > } // FooServiceImpl
>
> > It prints out the following messages:
>
> > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
>
> > Notice that it prints out more than 1 time. I double/triple checked
> > that I only call the bar() method once.
>
> > Then, I modified the code as the following:
>
> > public class FooServiceImpl extends RemoteServiceServlet implements
> > ControllerInputService {
>
> >       �...@override
> >     public String bar(String input) {
> >          ...
> >          counter++;
> >          logger.debug(counter + " Entering ... bar()");
> >          System.out.println(counter + " Entering ... bar() from
> > System.out.println()");
> >         ...
> >     }
>
> >        private int counter = 0;
>
> >        private static final Logger logger = Logger.getLogger
> > (FooServiceImpl .class.getName());
> > } // FooServiceImpl
>
> > It produces the following output:
>
> > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > ()
> > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > ()
> > 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> > ()
> > 1 Entering ... bar() from System.out.println()
>
> > Notice that there are still several log outputs (not as expected - I
> > only expect only 1 output) but only one output from System.out.println
> > () (as expected) and the counter is still 1 (as expected).
>
> > My log4j.properties
>
> > # A default log4j configuration for log4j users.
> > #
> > # To use this configuration, deploy it into your application's WEB-INF/
> > classes
> > # directory.  You are also encouraged to edit it as you like.
>
> > # Configure the console as our one appender
> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c]
> > - %m%n
>
> > My environtments: GAE 1.2.5, GWT 1.7, Eclipse-Galileo on Windows
> > Vista.
>
> > Why do I have several log output?
>
> > Thanks in advance for your help.
--~--~-~--~~~---~--~~
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-java@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: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread Marcel Overdijk

I think the docs about low level api is rather limited. Some examples
would be nice.

On Sep 23, 4:33 pm, Clay Lenhart  wrote:
> +1
>
> We're having a similar discussion here:
>
> http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> Andy,
> My view is that there is no productivity difference between the two.
>
> It might be good to show us what is difficult to do in the datastore
> but easy in JDO.
>
> Cheers,
> Clay
>
> On Sep 23, 11:02 am, datanucleus  wrote:
>
>
>
> > > BigTable simply is not a relational db, so it is highly misleading to
> > > fake a relational wrapper and to me it caused lots of pain.
>
> > Apart from the fact that JDO is not a "relational wrapper". The API
> > and metadata are object-based; only a subset of metadata is specific
> > to "mapped" datastores and this is marked clearly in the (DataNucleus)
> > docs.
>
> > As ever, if you have some specific issue to raise why not define it -
> > e.g something that can be done in the low level API that can't be done
> > via a generic 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-java@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: Extra log output

2009-09-23 Thread Toby Reyelts
You're using java.util.logging, not log4j. What does your logging.properties
file look like?

On Wed, Sep 23, 2009 at 5:02 PM, Pion  wrote:

>
> I have the following code snippet:
>
> public class FooServiceImpl extends RemoteServiceServlet implements
> ControllerInputService {
>
>@Override
> public String bar(String input) {
>  ...
>  logger.debug("Entering ... bar()");
> ...
> }
>
>private static final Logger logger = Logger.getLogger
> (FooServiceImpl .class.getName());
> } // FooServiceImpl
>
> It prints out the following messages:
>
> 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
> 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
>
> Notice that it prints out more than 1 time. I double/triple checked
> that I only call the bar() method once.
>
> Then, I modified the code as the following:
>
> public class FooServiceImpl extends RemoteServiceServlet implements
> ControllerInputService {
>
>@Override
> public String bar(String input) {
>  ...
>  counter++;
>  logger.debug(counter + " Entering ... bar()");
>  System.out.println(counter + " Entering ... bar() from
> System.out.println()");
> ...
> }
>
>private int counter = 0;
>
>private static final Logger logger = Logger.getLogger
> (FooServiceImpl .class.getName());
> } // FooServiceImpl
>
> It produces the following output:
>
> 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> ()
> 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> ()
> 0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
> ()
> 1 Entering ... bar() from System.out.println()
>
> Notice that there are still several log outputs (not as expected - I
> only expect only 1 output) but only one output from System.out.println
> () (as expected) and the counter is still 1 (as expected).
>
> My log4j.properties
>
> # A default log4j configuration for log4j users.
> #
> # To use this configuration, deploy it into your application's WEB-INF/
> classes
> # directory.  You are also encouraged to edit it as you like.
>
> # Configure the console as our one appender
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c]
> - %m%n
>
> My environtments: GAE 1.2.5, GWT 1.7, Eclipse-Galileo on Windows
> Vista.
>
> Why do I have several log output?
>
> Thanks in advance for your help.
> >
>

--~--~-~--~~~---~--~~
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-java@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: query performance problem

2009-09-23 Thread lent

We upgraded to appengine-java-sdk 1.2.5 today (from 1.2.2) and the
performance seems to
be back to what we were experiencing earlier which was well under a
second for 100 entities.

We're not sure why but the performance when we were using 1.2.2 was
similar to not specifying
the one to one owned fields as lazy loading.

Len
On Sep 22, 10:42 am, lent  wrote:
> Hello,
>
> We are using JPA and the retrieval of one of our kinds seems to be
> quite slow at about 3-4 seconds per 100 in production.  The entities
> of this kind are not in the same entity group.  We have made some
> adjustments to the kind recently which may have caused the slow down.
> The persistent class definition is as below.  We used to have a blob
> field for content which we have moved to a separate class
> (ContentValue) and created OneToOne owned relationship with (we used
> to have one blob for content but now we have 2 ContentValue fields).
> Two of our fields used to be String but now has been converted to
> List fields.  We have added a OneToMany owned relationship to
> another class.  We seemed to recall performance used to be better
> prior to some of these adjustments.  Is the performance we're seeing
> reasonable?
>
> The query we issue is as follows with the number of results capped at
> 100 using setMaxResult on the query in JPA:
> select c from Contributor c where id > someId
>
> From the retrieved query result, we do not access the two ContentValue
> fields or the ContactCollection list.  Some datanucleus debug output
> is also at the bottom.
>
> Any insights into the performance would be appreciated.
>
> Regards,
> Len
>
> @Entity
> public class Contributor {
>         @Id
>         @GeneratedValue(strategy=GenerationType.IDENTITY)
>         @Extension(vendorName="datanucleus", key="gae.encoded-pk",
> value="true")
>         private String id;
>
>         @Enumerated
>         @Extension(vendorName="datanucleus", key="gae.parent-pk",
> value="true")
>         private String userId;
>
>         @Enumerated
>         private String firstName;
>
>         @Enumerated
>         private String lastName;
>
>         @Enumerated
>         private String title;
>
>         @Enumerated
>         private String division;
>
>         @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
>         private ContentValue picture;
>
>         @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
>         private ContentValue thumbnailPicture;
>
>         @OneToMany(cascade = CascadeType.ALL)
>         private List collections = new
> ArrayList();
>
>         @Enumerated
>         private String bio;
>
>         @Enumerated
>         private List skills;
>
>         @Enumerated
>         private List qualifications;
>
>         @Enumerated
>         private Date birthDate;
>
>         @Enumerated
>         private String workEmail;
>
>         @Enumerated
>         private String workOfficePhone;
>
>         @Enumerated
>         private String workMobilePhone;
>
>         @Enumerated
>         private String personalEmail;
>
>         @Enumerated
>         private String homePhone;
>
>         @Enumerated
>         private String personalMobilePhone;
>
>         // accessors
>         ...
>
> }
>
> DataNucleus Debug Output:
> 
> D 09-21 04:36PM 34.665
> org.datanucleus.ObjectManagerImpl getObjectFromCache: Object with id
> "com.jostleme.jostle.server.domain.Contributor:agpzaGFxYmFtYnUzchwLEgRVc2Vy­GN87DAsSC0NvbnRyaWJ1dG9yGAEM"
> not found in Level 1 cache [cache size = 0]
> D 09-21 04:36PM 34.667
> org.datanucleus.ObjectManagerImpl getObjectFromCache: Object with id
> "com.jostleme.jostle.server.domain.Contributor:agpzaGFxYmFtYnUzchwLEgRVc2Vy­GN87DAsSC0NvbnRyaWJ1dG9yGAEM"
> not found in Level 1 cache [cache size = 0]
> D 09-21 04:36PM 34.667
> org.datanucleus.ObjectManagerImpl putObjectIntoCache: Object
> "com.jostleme.jostle.server.domain.contribu...@12c4d93" 
> (id="com.jostleme.jostle.server.domain.Contributor:agpzaGFxYmFtYnUzchwLEgRV­c2VyGN87DAsSC0NvbnRyaWJ1dG9yGAEM")
> added to Level 1 cache (loadedFlags="[NNNYNN]")
> D 09-21 04:36PM 34.766
> org.datanucleus.sco.backed.List : Object
> "com.jostleme.jostle.server.domain.contribu...@12c4d93" field
> "collections" is replaced by a SCO wrapper of type
> "org.datanucleus.sco.backed.List" [cache-values=true, lazy-
> loading=true, queued-operations=true, allow-nulls=false]
> D 09-21 04:36PM 34.773
> org.datanucleus.ObjectManagerImpl getObjectFromCache: Object with id
> "com.jostleme.jostle.server.domain.Contributor:agpzaGFxYmFtYnUzchwLEgRVc2Vy­GOA7DAsSC0NvbnRyaWJ1dG9yGAEM"
> not found in Level 1 cache [cache size = 1]
> D 09-21 04:36PM 34.773
> org.datanucleus.ObjectManagerImpl getObjectFromCache: Object with id
> "com.jostleme.jostle.server.domain.Contributor:agpzaGFxYmFtYnUzchwLEgRVc2Vy­GOA7DAsSC0NvbnRyaWJ1dG9yGAEM"
> not found in Level 1 cache [cache size = 1]
> D 09-21 04:36PM 34.774
> org.datanucleus.ObjectManag

[appengine-java] Extra log output

2009-09-23 Thread Pion

I have the following code snippet:

public class FooServiceImpl extends RemoteServiceServlet implements
ControllerInputService {

@Override
 public String bar(String input) {
  ...
  logger.debug("Entering ... bar()");
 ...
 }

private static final Logger logger = Logger.getLogger
(FooServiceImpl .class.getName());
} // FooServiceImpl

It prints out the following messages:

0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()
0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - Entering ... bar()

Notice that it prints out more than 1 time. I double/triple checked
that I only call the bar() method once.

Then, I modified the code as the following:

public class FooServiceImpl extends RemoteServiceServlet implements
ControllerInputService {

@Override
 public String bar(String input) {
  ...
  counter++;
  logger.debug(counter + " Entering ... bar()");
  System.out.println(counter + " Entering ... bar() from
System.out.println()");
 ...
 }

private int counter = 0;

private static final Logger logger = Logger.getLogger
(FooServiceImpl .class.getName());
} // FooServiceImpl

It produces the following output:

0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
()
0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
()
0 [btpool0-3] DEBUG com.col.server.FooServiceImpl - 1 Entering ... bar
()
1 Entering ... bar() from System.out.println()

Notice that there are still several log outputs (not as expected - I
only expect only 1 output) but only one output from System.out.println
() (as expected) and the counter is still 1 (as expected).

My log4j.properties

# A default log4j configuration for log4j users.
#
# To use this configuration, deploy it into your application's WEB-INF/
classes
# directory.  You are also encouraged to edit it as you like.

# Configure the console as our one appender
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c]
- %m%n

My environtments: GAE 1.2.5, GWT 1.7, Eclipse-Galileo on Windows
Vista.

Why do I have several log output?

Thanks in advance for your help.
--~--~-~--~~~---~--~~
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-java@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(defaultFetchGroup="false")

2009-09-23 Thread Max

How do I fetch field that is not declared like:-

@Persistent(defaultFetchGroup="true")

I am using JDO

Thanks, Max


--~--~-~--~~~---~--~~
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-java@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: subquries example

2009-09-23 Thread Jason (Google)
App Engine's JDO implementation does not currently support subqueries, no.
The only aggregate function that you can use is count, but this only works
if you have 1,000 or fewer entities in the datastore. The more reliable (and
scalable) way of computing aggregate values is at write time as Marcel says.
So if you know you'll need the number of entities of a particular kind, say,
then you can keep a counter in the datastore and increment it every time you
persist a new entity of that kind. Then, when the count is needed, the value
is already available. You can do this in a similar way for the other
aggregate functions.
- Jason

On Tue, Sep 22, 2009 at 2:38 AM, rams  wrote:

>
> hi
>
> i want to know that
>
> does java app engine has a support for subqueries in jdo ?
> does java app engine has a support for  aggregate functions of jdo?
>
> if it supports  please send me one example on subqueries in jdo.
>
> if it doesn't has support for aggregate function then how to manage
> queries that contains aggregate functions?
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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-java@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: Regarding sending login details to gmail

2009-09-23 Thread Jason (Google)
If you haven't gone through the Getting Started Guide, I highly recommend
you do so now -- this will help you a lot with this particular set of
requirements:
http://code.google.com/appengine/docs/java/gettingstarted/

Basically, you'll want to create a new servlet and implement the doPost
method. The request object is passed into doPost so you can access form
parameters such as the email address that the user provided. Then you can
store these in App Engine's datastore or send an email, whatever you'd like.

I'll also point out here that if all you're looking for is user
authentication, you don't have to roll your own registration process. App
Engine has a Google Accounts service which can authenticate users via their
Gmail addresses or other Google accounts without any extra work on your
part. This is covered in the Getting Started Guide as well.

- Jason

On Tue, Sep 22, 2009 at 2:22 AM, anu  wrote:

>
> Hi i have developed an application using googleappenginesdk with java
> using eclipse. and my application is nothing but registration process
> first i have developed pages for registration and login pages.once the
> usser want to register himself he clicks on register link and he
> redirected to registration page and registers himself once he register
> i want to fetch or catch (those input fields like
> username,password,email id etc that  the user has given for the
> registration purpose ) and  send a mail for confirmation of
> registration to the corresponding email id given by the user.So when
> user gives all the input fields and click register button a mail has
> to be given to the users email id  (like gmail )for confirmation  .So
> how can i define functionality to register button so that the
> functionality which iam expecting can be achieved ,please someone help
> me with the solution .
>
> I have created now only html pages and unable to define functionality
> to the button ,someone help me
> The pages which i have created is
>
>
> home.jsp
>
> 
> 
> 
> 
> 
> 
> 
>
> 
>
>
>  
>  
>  New User
>  
>Register
>Login
>  
>
>
>  
> 
>
>
>
> Success.html
>
> 
> 
> You have Succesfully Registered
> 
> 
>
>
>
> Register.html
>
> 
> 
> 
> 
> 
> 
> 
>
> 
>  
>
>FIRST NAME
>LAST NAME
>   EMAIL ID
>USER NAME
>PASSWORD
>  
>
>  
>
> 
>
>
>
> thanks in advance,
>
> anu
>
> >
>

--~--~-~--~~~---~--~~
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-java@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: server error gcl query datastore

2009-09-23 Thread Jason (Google)
See
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html for
sample usage.
In this case, you should be using:

Query query = pm.newQuery("select from Subscriber where make ==
'someone' order by dateCreated asc");

This is JDOQL, which uses Java syntax. In particular, you need to use == for
comparison rather than a single =.

- Jason

On Tue, Sep 22, 2009 at 12:37 AM, mar_novice wrote:

>
> is this gql correct?
> SELECT * FROM Subscriber where make = 'someone' order by dateCreated
>
> if so, why i got server error?
> if not, what is the correct query?
>
> 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-java@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: can xmpp api send and receive messages using gmail ids?

2009-09-23 Thread Prashant
yes, exactly. I tried it and it is not allowing to me send message from my
gtalk id :(

On Wed, Sep 23, 2009 at 11:59 PM, Jason (Google) wrote:

> I think I understand what you're saying -- you want to send one or more
> updates via XMPP to your friends from your own GTalk ID through your App
> Engine application. This should work too because the MessageBuilder class
> allows you to specify a fromJid (your Gmail address) and an array of
> recipientJids (your friends' Jabber IDs, Gmail or otherwise). Is this what
> you're looking for?
> - Jason
>
> On Mon, Sep 21, 2009 at 9:29 PM, Prashant  wrote:
>
>> no, no, no, i meant to say that i want to send/receive xmpp to my friends'
>> ids etc. form my gmail id using my app (instead of gTalk), say a kind of
>> automated replies. if it is possible then how?
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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-java@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: can xmpp api send and receive messages using gmail ids?

2009-09-23 Thread Jason (Google)
I think I understand what you're saying -- you want to send one or more
updates via XMPP to your friends from your own GTalk ID through your App
Engine application. This should work too because the MessageBuilder class
allows you to specify a fromJid (your Gmail address) and an array of
recipientJids (your friends' Jabber IDs, Gmail or otherwise). Is this what
you're looking for?
- Jason

On Mon, Sep 21, 2009 at 9:29 PM, Prashant  wrote:

> no, no, no, i meant to say that i want to send/receive xmpp to my friends'
> ids etc. form my gmail id using my app (instead of gTalk), say a kind of
> automated replies. if it is possible then how?
>
>
> >
>

--~--~-~--~~~---~--~~
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-java@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: How to store tree ? example?

2009-09-23 Thread Max

Thank You your example it is very helpful!

Do you have any performance problems?

I am concerned about 30 put request limit.

I am considering your solution or storing tree as JSON string or both.
I need unique ID for each tree node.

Cheers, Max

On Sep 23, 4:26 pm, Ian Marshall  wrote:
> Hi Max,
>
> I have a tree structure using JDO, where each instance of the entity
> has one parent and zero or more children. These relationships cannot
> be performed by GAE/J currently due to outstanding bugs in self-
> referential owned relationships.
>
> So I model these relationships as unowned, using each entity's Long ID
> as key. Each entity also has an entity group parent (in my example
> below, the same instance of my class EntityGroupRoot). By using a
> common entity group parent, one can ensure that all entities are in
> the same entity group (if one wants that).
>
> The drawback for the work-around is that the unowned parental and
> child relationships have to be kept up to date manually by your app.
>
> My example of a working persistent entity class follows Do let me
> know if this helps you succeed.
>
> Regards,
>
> Ian
>
> package [...];
>
> import java.io.Serializable;
> import java.util.ArrayList;
> import javax.jdo.annotations.IdGeneratorStrategy;
> import javax.jdo.annotations.IdentityType;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.Persistent;
> import javax.jdo.annotations.PrimaryKey;
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION,
>  detachable = "true")
> public class ItemCategory implements Serializable
> {
>   private static final long serialVersionUID = 1L;
>
>   
> //
>   // This block is required since this entity has an entity group
> root.
>   // It does not work with MySQL, so we use an alternative for that
> database.
>   // We have the getter method for getting the encoded key here for
> convenience.
>   //
>
>   @PrimaryKey
>   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>   @Extension(vendorName="datanucleus", key="gae.encoded-pk",
> value="true")
>   private String sEncodedKey;
>
>   @Persistent
>   @Extension(vendorName="datanucleus", key="gae.pk-id", value="true")
>   private Long loID;
>
>   public String getEncodedKey()
>   {
>     return sEncodedKey;
>   }
>
>   //
>   
> //
>
>         /*
>   
> //
>   // This block is required for testing with MySQL only, and will not
> work
>   // for Google BigTable.
>   //
>
>   @PrimaryKey
>   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>   private Long loID;
>
>   //
>   
> //
>         */
>
>   @Persistent
>   private EntityGroupRoot egrEntityGroupParent;
>
>   @Persistent
>   private Long loParentID;
>
>   @Persistent
>   private ArrayList liChildIDs = new ArrayList();
>
>   @Persistent
>   private String sName;
>
>   @Persistent
>   private Boolean bActive;
>
>   
> //
>   // Getter methods (except getting the encoded key,
>   // which is grouped with its field for convenience).
>   //
>
>   public Long getID()
>   {
>     return loID;
>   }
>
>   public EntityGroupRoot getEntityGroupParent()
>   {
>     return egrEntityGroupParent;
>   }
>
>   public Long getParentID()
>   {
>     return loParentID;
>   }
>
>   public ArrayList getChildIDs()
>   {
>     ArrayList alIDs = liChildIDs;
>
>     if (alIDs == null)
>       alIDs = new ArrayList();
>
>     return alIDs;
>   }
>
>   public String getName()
>   {
>     return sName;
>   }
>
>   public boolean getActive()
>   {
>     boolean bResult = false;
>
>     if ((bActive != null) && bActive.booleanValue())
>       bResult = true;
>
>     return bResult;
>   }
>
>   //
>   
> //
>
>   
> //
>   // Setter methods
>   //
>
>   public void setEntityGroupParent(EntityGroupRoot entityGroupParent)
>   {
>     egrEntityGroupParent = entityGroupParent;
>   }
>
>   public void setParentID(Long parentID)
>   {
>     loParentID = parentID;
>   }
>
>   public void setChildIDs(ArrayList childIDs)
>   {
>     liChildIDs = childIDs;
>   }
>
>   public void setName(String name)
>   {
>     sName = name;
>   }
>
>   public void setActive(boolean active)
>   {
>     bActive = new Boolean(active);
>   }
>
>   //
>   
> //
>
>   
> //
>   // Other methods
>   //
>
>   public void addChildID(Long loChildID)
>   {
>     if (liChildIDs == null)
>      

[appengine-java] Re: GAE JUnit testing documentation

2009-09-23 Thread Jason (Google)
Hi Pion. If you are having a hard time understanding a certain concept or
where to place a certain piece of code, please let me know and I'll help you
directly.
You can find a range of samples in the demos directory of the Java SDK,
which you can download from http://code.google.com/appengine/downloads.html.
And there are even more samples checked in to the Google Code project:

http://code.google.com/p/googleappengine/source/browse/#svn/trunk/java/demos

In
particular, guestbook is a good introductory project.

- Jason

On Mon, Sep 21, 2009 at 4:07 PM, Pion  wrote:

>
> I am reading
> http://code.google.com/appengine/docs/java/howto/unittesting.html.
> I am having a hard time to understand it.
>
> Where can I find any/all of the following doc/code/sample?
>
> * Complete "Hello World" sample?
>
> * Complete sample using the GAE Getting Started
>
> http://code.google.com/appengine/docs/java/gettingstarted/usingdatastore.html
>
> * The Javadoc of
> com.google.appengine.tools.development.ApiProxyLocalImpl and
>  com.google.apphosting.api.ApiProxy.
>
> * Any more doc/sample/code will help.
>
> Thanks in advance for your help.
> >
>

--~--~-~--~~~---~--~~
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-java@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] How catch deploy event?

2009-09-23 Thread Jun Tsai

hi,
  I want to clean some data when deploy the application on appspot.how
to do that?


ps: I find the application would closed when it wasn't active.so I
couldn't use servlet startup  event.
--~--~-~--~~~---~--~~
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-java@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: Multimap in JDO

2009-09-23 Thread Jason (Google)
If you use a non-native datastore type that isn't declared to be
PersistenceCapable, you need to explicitly indicate that it is serializable:
@Persistent(serializable = "true")
Multimap map;

...

This should work if the class of the object implements Serializable. For
instance, I've been able to store HashMap objects this way.

- Jason

On Mon, Sep 21, 2009 at 2:26 PM, Dhamu  wrote:

>
> How to use multimap (http://google-collections.googlecode.com/svn/
> trunk/javadoc/com/google/common/collect/Multimap.html) in jdo?
>
>
> I get the following exception.
> org.datanucleus.exceptions.NucleusUserException: Field
> "...model.jdo.MyModel.content" is declared as a reference type
> (interface/Object) but no implementation classes of
> "com.google.common.collect.Multimap" have been found!
>
> please help!!
> >
>

--~--~-~--~~~---~--~~
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-java@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: regarding null pointer exception

2009-09-23 Thread Rajeev Dayal
Can you post the full stack trace?

On Wed, Sep 23, 2009 at 8:20 AM, anu  wrote:

>
> Hi every body,
>
>  iam develpoing a sample application for login form with
> validations and persist the data by using googleappengine with java
> using eclipse.but iam getting the null pointer exception at the time
> of running.plz any one tell me the solution.
> my code is
> registe.jsp
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> <%@ page import="java.util.List" %>
>
> <%@ page import="java.util.ArrayList" %>
>
> <%@ page import="javax.jdo.PersistenceManager" %>
>
> <%@ page import="javax.jdo.Query" %>
>
> <%@ page import="com.google.org.*" %>
>
> 
> 
>
> function button_actions()
> {
>  var flag=0;
>  var errors="";
>
>  if(!document.my_form.first_name.value)
>  {
>   alert("you need to supply your first name");
>document.my_form.first_name.focus();
>return false;
>  }
>  if(!document.my_form.last_name.value)
>  {
>   alert("you need to supply your last name");
>document.my_form.last_name.focus();
>return false;
>  }
>
>var id = document.my_form.email.value;
>var re = /^...@.+\..{2,4}$/gi;
>if(!id.match(re))
> {
>flag++;
>errors = errors + "E-Mail\n";
>
> }
>   if(flag > 0)
>{
>alert("invalid email adress\n"+
>errors+"\nPlease re-enter email-id.");
>return 0;
>}
>
>
>   if(!document.my_form.user_password.value)
> {
>alert("you need to supply your passsword");
> document.my_form.user_password.focus();
> return false;
> }
>
>
> }
>
> 
>
>  
>
>
> 
>  
>example
>  
> 
>
>
> new entry
>
>
>  
>   
>   First Name
>   
>
>   LastName
>   
>
>   Email
>   
>
>   password
>   
>
>   confirm password
>   
>
>   
>
>   
> 
>   
>entries
>   
>
>  
>   <%
>List entries= new ArrayList();
>PersistenceManager pm=PMF.get().getPersistenceManager();
>Query query=pm.newQuery("SELECT FROM " +entry.class.getName());
>entries=(List) query.execute();
>
>   %>
>  <%
>if(entries.isEmpty()) {
>   %>
>
>   <%
>   }
>   else {
>   %>
>
><%
>  for(entry e:entries){
>%>
>
>   <%=e.getEmail()%>
>   Quantity is<%=e.getUser_password()%> div>
>
><%
>}
>}
>%>
>  
>
>  
> 
>
>
>
>
> web.xml:
>
> 
>Shop2
>com.google.org.Shop2Servlet
>
>
>Shop2
>/shop2
>
>
>shop2.jsp
>
> 
>
>
>
> enty.java
>
> import javax.jdo.annotations.IdGeneratorStrategy;
> import javax.jdo.annotations.IdentityType;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.Persistent;
> import javax.jdo.annotations.PrimaryKey;
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class entry {
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Long id;
>@Persistent
>private String first_name;
>@Persistent
>private String last_name;
>@Persistent
>private String email;
>@Persistent
>private String user_password;
>@Persistent
>private String confirm_password;
>public entry(String email,String user_password)
>{
>this.email= email;
>this.user_password= user_password;
>
>}
>public Long getId() {
>return id;
>}
>public void setId(Long id) {
>this.id = id;
>}
>/*public String getFirst_name() {
>return first_name;
>}
>public void setFirst_name(String firstName) {
>first_name = firstName;
>}
>public String getLast_name() {
>return last_name;
>}
>public void setLast_name(String lastName) {
>last_name = lastName;
>}*/
>public String getEmail() {
>return email;
>}
>public void setEmail(String email) {
>this.email = email;
>}
>public String getUser_password() {
>return user_password;
>}
>public void setUser_password(String userPassword) {
>user_password = userPassword;
>}
>/*public String getConfirm_password() {
>return confirm_password;
>}
>public void setConfirm_password(String confirmPassword) {
>confirm_password = confirmPassword;
>}*/
>
> }
>
>
> pmf.java
> package com.google.org;
>
>
>
> import javax.jdo.JDOHelper;
> import javax.jdo.PersistenceManagerFactory;
>
> public final class PMF {
>private static final PersistenceManagerFactory pmfInstance =
>JDOHelper.getPersistenceManagerFactory("transactions-
> optional");
>
>private PMF() {}
>
>  

[appengine-java] Re: JDO vs low level API

2009-09-23 Thread Raj

I am not going to talk much about portability part. I believe
everybody undestands that.. and some are ok with continuing with GAE
datastore forever. But there can be changes in the APIs in later
releases of GAE. Your code might working with later releases; but
there can be better ways of doing the same thing in the new releases.
By using low level APIs you might end up in suboptimal solution in
that case. With a stanard like JPA , the risk of getting into this
kind of situation will be less since with JPA the internal details are
abtracted from the developers and GAE JPA implementation will be
internally optimized with new releases.

Leaving portability part, I personally felt that use of JPA/JDO was
much easier than using low level APIs. I had to spend couple of days
before I could figure out how JPA works. But since I figured it out
now, I can simply write Java code without bothering much about the
underlying databse or the SQL/GQL/whatever it is.
As a Java developers it is much easier for me to think in terms of
classes and objects than tables and data in them.

While fecthing the data, it is much easier for me to get it as a Java
object which strongly typed against an entity which can have prop1,
prop2 in one case and prop1 and pro3 in other case.
In this hypothetical scenario, it might sound like a limitation. But
if there is a case like that, as a Java developer, I would either
create two different Java classes or create a Java class which has the
superset of the fields that possible in all possible cases based
whether the data is relevant. Alternatively I will use a Map and store
such values as key-value pairs. (Since Map is not directly supported,
I may create a array of objects of another class that contain the name
and value fields or serialize it while storing the data)

In case of large number if records in child objects, I beleive you can
directly query based on the child object's class provided you know
some unique Identfier for the child object which required even with
low level APIs.

Similarly, any other limitations on the JPA or JDO has a workaround
and most of these will done while you are creating your basic set of
Java classes. Once the hierarchy is created, I don't see any of the
limiations will be encountered in runtime.

Anyway,  finally it is the individual developer's call on what he/she
is comfortable with. And in some cases, we may have to choose a
combination of different options based on what is best suitable for
the scenario.
--~--~-~--~~~---~--~~
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-java@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: Announcing App Engine Unit (alpha)

2009-09-23 Thread Max Ross
JUnit 4 support is already in thanks to a very helpful contributor, just
download the latest zip.

Max

On Wed, Sep 23, 2009 at 6:51 AM, Ian Marshall wrote:

>
> This should be excellent, Max!
>
> I have starred issue 1 (Support tests that access the datastore) and
> issue 5 (JUnit 4 support) since I am just about to start to use JUnit4
> (this is my next task) and my tests will be almost pure datastore
> testing.
>
> I'll keep an eye on this project of yours.
>
> Regards,
>
> Ian
> >
>

--~--~-~--~~~---~--~~
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-java@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] java swing api usage proble

2009-09-23 Thread Pedro Henrique Oliveira dos Santos

Hi, I'm facing an problem:
"javax.swing.ListSelectionModel is not supported by Google App
Engine's Java runtime environment"
I have an project that in java that uses some swing api, and I can't
compile it to google app engine. Something I can do about?


--~--~-~--~~~---~--~~
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-java@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] will it make any difference if i do not provide a separate class (PMF) for PersistentManagerFactory

2009-09-23 Thread Prashant
Hi,


Will it make any difference to the performance of the app if I do not write
a separate class (PMF, as suggested in GAE docs) for getting
PersistentManagerFactory instance, instead, I declare it as a variable in
the class where I want to use it, like

protected final PersistenceManagerFactory pmf =
JDOHelper.getPersistenceManagerFactory("transactions-optional");

// NOTE: I am not using *static* keyword.

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-java@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: Seeing different (incorrect?) JDO behavior after upgrading to 1.2.5

2009-09-23 Thread Patrizio Munzi




Hello Ian,

I tried changing the order of calls makePersistent. Now is:

makePersistent(user);
makePersistent(stat);

but still the same problem.

Thanks

Ian Marshall wrote:

  Hello Patrizio,

I do not think that my brain could cope with the generation of the
encoded key myself. I would prefer to add the field like

  @Persistent
  @Extension(vendorName="datanucleus", key="gae.pk-name",
value="true")
  private String keyName;

and set that instead with a class-unique String, leaving encodedKey
null. This would let GAE/J do the work of ensuring that each
encodedKey is unique in BigTable!

User is the entity parent of Stat, and you set this relationship at
the parental side. Your code, I think, persists Stat before you have
set the relationship at the child side. So you are persisting Stat
with no entity group parent before you persist User.

Try to persist User first before persisting Stat. Since you have
already set the User's Stat, this might work... :)

Regards,

Ian


  


-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi



--~--~-~--~~~---~--~~
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-java@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: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread Clay Lenhart

+1

We're having a similar discussion here:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/e406e4f77548f803?hl=en

Andy,
My view is that there is no productivity difference between the two.

It might be good to show us what is difficult to do in the datastore
but easy in JDO.

Cheers,
Clay





On Sep 23, 11:02 am, datanucleus  wrote:
> > BigTable simply is not a relational db, so it is highly misleading to
> > fake a relational wrapper and to me it caused lots of pain.
>
> Apart from the fact that JDO is not a "relational wrapper". The API
> and metadata are object-based; only a subset of metadata is specific
> to "mapped" datastores and this is marked clearly in the (DataNucleus)
> docs.
>
> As ever, if you have some specific issue to raise why not define it -
> e.g something that can be done in the low level API that can't be done
> via a generic 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-java@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: Seeing different (incorrect?) JDO behavior after upgrading to 1.2.5

2009-09-23 Thread Ian Marshall

Hello Patrizio,

I do not think that my brain could cope with the generation of the
encoded key myself. I would prefer to add the field like

  @Persistent
  @Extension(vendorName="datanucleus", key="gae.pk-name",
value="true")
  private String keyName;

and set that instead with a class-unique String, leaving encodedKey
null. This would let GAE/J do the work of ensuring that each
encodedKey is unique in BigTable!

User is the entity parent of Stat, and you set this relationship at
the parental side. Your code, I think, persists Stat before you have
set the relationship at the child side. So you are persisting Stat
with no entity group parent before you persist User.

Try to persist User first before persisting Stat. Since you have
already set the User's Stat, this might work... :)

Regards,

Ian
--~--~-~--~~~---~--~~
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-java@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] Merge join + Key Name used to emulate sort field

2009-09-23 Thread Cornel

Hello!

I recently discovered the power of merge joins on app-engine (no more
composite indexes required! hurray!).
I am also aware that i cannot inequality filters, neither order
clauses.

But what if i generate the primary key of the entities using the
values of the field i wish to order by. This way, since entities are
ordered (by default) by key ascending, it means they will effectively
be ordered by my criteria.

I also realized that this would work only for entities with no
parents. Otherwise the parent part of the key will mess things up (it
is compared first and this will determine the real order! which is not
what i need/want); solution -> no parents ;)

Quote from compareTo() method of Key:
"The relationship between individual Key Keys is performed by
comparing app followed by kind followed by id. If both keys are
assigned names rather than ids, compares names instead of ids. If
neither key has an id or a name we return an arbitrary but consistent
result. Assuming all other components are equal, all ids are less than
all names. "


More specifically: "if both keys are assigned names rather than ids,
compares names instead of ids". Are names compared lexically? It seems
so, but i want to be sure. Can you tell 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-java@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: Announcing App Engine Unit (alpha)

2009-09-23 Thread Ian Marshall

This should be excellent, Max!

I have starred issue 1 (Support tests that access the datastore) and
issue 5 (JUnit 4 support) since I am just about to start to use JUnit4
(this is my next task) and my tests will be almost pure datastore
testing.

I'll keep an eye on this project of yours.

Regards,

Ian
--~--~-~--~~~---~--~~
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-java@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: strange behavior of one-to-one owned (one-direction) relationship

2009-09-23 Thread Patrizio Munzi




Hi Ian,

thank you for your tip, but I did already change my code that way and
it worked.

Now I'm facing another really strange problem:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/41b5219aa26aacaa/d8342ad1d19e35c9#d8342ad1d19e35c9

Maybe you could give it a glance.

Thanks

Ian Marshall wrote:

  Hi Patrizio,

You might find it much easier to create each User's Stat instance
outside of your User class. (Knowing my brain, I personally would find
this easier and simpler!)

As a first step, why not replace

  @Persistent
  private Stat stat= new Stat();

with

  @Persistent
  private Stat stat;


and add a setter method

  public void setStat(Stat stStat)
  {
stat = stStat;
  }


and then create your Stat instances elsewhere in your app?

It could be (and GAE/J experts may correct me here) that the line

  private Stat stat= new Stat();

causes a new instance to be created each time a User instance is
brought forth into your app (by a create, fetch, etc.)?

I trust that this might help,

Ian



  


-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi



--~--~-~--~~~---~--~~
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-java@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: strange behavior of one-to-one owned (one-direction) relationship

2009-09-23 Thread Ian Marshall

Hi Patrizio,

You might find it much easier to create each User's Stat instance
outside of your User class. (Knowing my brain, I personally would find
this easier and simpler!)

As a first step, why not replace

  @Persistent
  private Stat stat= new Stat();

with

  @Persistent
  private Stat stat;


and add a setter method

  public void setStat(Stat stStat)
  {
stat = stStat;
  }


and then create your Stat instances elsewhere in your app?

It could be (and GAE/J experts may correct me here) that the line

  private Stat stat= new Stat();

causes a new instance to be created each time a User instance is
brought forth into your app (by a create, fetch, etc.)?

I trust that this might help,

Ian

--~--~-~--~~~---~--~~
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-java@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: How to location my service in Unit testing?

2009-09-23 Thread Donny

Got it, really appreciate your detailed demo, thanks.:)

On Sep 23, 6:15 pm, leszek  wrote:
> You need to have your data access method separated from servlet code
> or RPC (if GWT is used) code.
>
> Assume that you have something like:
>
> class Customer  {
>
>   private Key customerId;
> ...
>
> }
>
> class MyDataAccessService {
>
>   public void addCustomer(Customer c) {
>   ...
>   }
>
> and you want to test it.
>
> You can create separate project for test (and link sources with main
> project) or you can have test packages together with the main project.
>
> So you write your test case (assuming Junit4)
>
> public class TestCase1  {
>
>   ...
>   @Test
>   public void testAddingCustomer() {
>     Customer c = new Customer();
>     c.setCustomerId("google");
>     ...
>     MyDataAccessService service = new MyDataAccessService();
>     service.addCustomer(c);
>     // now test
>     PersistenceManager pm = ...
>     Customer c1 = pm.getObjectById(Customer.class, "google");
>     assertNotNull(c1);
>     assertEquals("google",c1.getCustomerId);
>     ..
>
> }
>
> Now you want to have this test enabled for local Google App Engine
> environment.
>
> Create classes us described under link and fix your test case.
>
> http://code.google.com/appengine/docs/java/howto/unittesting.html
>
> public class TestCase1 extends LocalDatastoreTestEnvironment {
>
>   �...@before
>    public void setUp() {
>      super.setUp();
>    }
>
>   �...@after
>    public void tearDown() {
>      super.tearDown();
>    }
>
>   �...@test
>    public void testAddingCustomer() {
>    ..
>
> }
>
> Now you can run TestCase1 as standard Junit Test (from Eclipse) and be
> happy.
>
> Addtional remark:
> You can avoid extending your TestCase and use simple composition.
>
> class TestCase {
>
>    LocalDatastoreTestEnvironment localStore = new
> LocalDatastoreTestEnvironment();
>
>   �...@before
>    public void setUp() {
>      localStore.setUp();
>    }
>
>   �...@after
>    public void tearDown() {
>      localStore.tearDown();
>    }
>
> Also you can change it anyway as you like and best fit to your
> purpose.
>
> Treat what is under link as a demo how this stuff is running, not as a
> dogma.
--~--~-~--~~~---~--~~
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-java@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: How to store tree ? example?

2009-09-23 Thread Ian Marshall

Hi Max,

I have a tree structure using JDO, where each instance of the entity
has one parent and zero or more children. These relationships cannot
be performed by GAE/J currently due to outstanding bugs in self-
referential owned relationships.

So I model these relationships as unowned, using each entity's Long ID
as key. Each entity also has an entity group parent (in my example
below, the same instance of my class EntityGroupRoot). By using a
common entity group parent, one can ensure that all entities are in
the same entity group (if one wants that).

The drawback for the work-around is that the unowned parental and
child relationships have to be kept up to date manually by your app.

My example of a working persistent entity class follows Do let me
know if this helps you succeed.

Regards,

Ian



package [...];

import java.io.Serializable;
import java.util.ArrayList;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION,
 detachable = "true")
public class ItemCategory implements Serializable
{
  private static final long serialVersionUID = 1L;


  //
  // This block is required since this entity has an entity group
root.
  // It does not work with MySQL, so we use an alternative for that
database.
  // We have the getter method for getting the encoded key here for
convenience.
  //

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  @Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
  private String sEncodedKey;

  @Persistent
  @Extension(vendorName="datanucleus", key="gae.pk-id", value="true")
  private Long loID;

  public String getEncodedKey()
  {
return sEncodedKey;
  }

  //
  //


/*
  //
  // This block is required for testing with MySQL only, and will not
work
  // for Google BigTable.
  //

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Long loID;

  //
  //
*/


  @Persistent
  private EntityGroupRoot egrEntityGroupParent;

  @Persistent
  private Long loParentID;

  @Persistent
  private ArrayList liChildIDs = new ArrayList();

  @Persistent
  private String sName;

  @Persistent
  private Boolean bActive;


  //
  // Getter methods (except getting the encoded key,
  // which is grouped with its field for convenience).
  //

  public Long getID()
  {
return loID;
  }

  public EntityGroupRoot getEntityGroupParent()
  {
return egrEntityGroupParent;
  }

  public Long getParentID()
  {
return loParentID;
  }

  public ArrayList getChildIDs()
  {
ArrayList alIDs = liChildIDs;

if (alIDs == null)
  alIDs = new ArrayList();

return alIDs;
  }

  public String getName()
  {
return sName;
  }

  public boolean getActive()
  {
boolean bResult = false;

if ((bActive != null) && bActive.booleanValue())
  bResult = true;

return bResult;
  }

  //
  //


  //
  // Setter methods
  //

  public void setEntityGroupParent(EntityGroupRoot entityGroupParent)
  {
egrEntityGroupParent = entityGroupParent;
  }

  public void setParentID(Long parentID)
  {
loParentID = parentID;
  }

  public void setChildIDs(ArrayList childIDs)
  {
liChildIDs = childIDs;
  }

  public void setName(String name)
  {
sName = name;
  }

  public void setActive(boolean active)
  {
bActive = new Boolean(active);
  }

  //
  //


  //
  // Other methods
  //

  public void addChildID(Long loChildID)
  {
if (liChildIDs == null)
  liChildIDs = new ArrayList();

liChildIDs.add(loChildID);
  }

  //
  //
}

--~--~-~--~~~---~--~~
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-java@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: Exception while getting data from HttpSession

2009-09-23 Thread Simon

Can you show the code for your Twitter class?

On Sep 22, 9:48 pm, Tahir Akram  wrote:
> I am getting following exception while getting data from session. I
> have following 2 servlets. One set session and other retrieve
> attribute from it. I have also sett session enable tag in appengine
> web xml file. (note: Using twitter4j)
>
> [FIRST SERVLET]
>
>  Twitter twitter = new Twitter();
>                    twitter.setOAuthConsumer("", "");
>                    RequestToken requestToken = null;
>                 try {
>                         requestToken = twitter.getOAuthRequestToken();
>                         log.info("OAuth token has been taken");
>                 } catch (TwitterException e) {
>                         log.warning(e.toString());
>                 }
>
>                 HttpSession session = request.getSession();
>                 if (session.getAttribute("twitter")==null){
>                         session.setAttribute("twitter", twitter);
>                         out.println("-> session 
> is set");
>                 }
>
>                 if (session.getAttribute("token")==null){
>                         session.setAttribute("token", requestToken);
>                         out.println("-> session 
> is set");
>                 }
>                 String authUrl = requestToken.getAuthorizationURL();
>
> [SECOND SERVLET]
>
>                         HttpSession session = request.getSession();
>
>                         twitter = (Twitter)session.getAttribute("twitter");
>                         r  = (RequestToken)session.getAttribute("token");
>
>                         twitter.setOAuthAccessToken(r.getAccessToken());
>
>                         twitter.updateStatus("Hello World!");
>
> #
> 09-22 01:34PM 12.913
>
> EXCEPTION
> javax.servlet.ServletException: java.lang.ArrayStoreException:
> [Ljava.lang.String;
>         at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
> (AppVersionHandlerMap.java:239)
>         at org.mortbay.jetty.handler.HandlerWrapper.handle
> (HandlerWrapper.java:139)
>         at org.mortbay.jetty.Server.handle(Server.java:313)
>         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> 506)
>         at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
> (HttpConnection.java:830)
>         at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable
> (RpcRequestParser.java:76)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>         at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest
> (JettyServletEngineAdapter.java:139)
>         at com.google.apphosting.runtime.JavaRuntime.handleRequest
> (JavaRuntime.java:235)
>         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:4950)
>         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:4948)
>         at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
> (BlockingApplicationHandler.java:24)
>         at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> 359)
>         at com.google.net.rpc.impl.Server$2.run(Server.java:823)
>         at com.google.tracing.LocalTraceSpanRunnable.run
> (LocalTraceSpanRunnable.java:56)
>         at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan
> (LocalTraceSpanBuilder.java:516)
>         at com.google.net.rpc.impl.Server.startRpc(Server.java:778)
>         at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
>         at com.google.net.rpc.impl.ServerConnection.messageReceived
> (ServerConnection.java:437)
>         at com.google.net.rpc.impl.RpcConnection.parseMessages
> (RpcConnection.java:319)
>         at com.google.net.rpc.impl.RpcConnection.dataReceived
> (RpcConnection.java:290)
>         at com.google.net.async.Connection.handleReadEvent(Connection.java:
> 428)
>         at com.google.net.async.EventDispatcher.processNetworkEvents
> (EventDispatcher.java:762)
>         at com.google.net.async.EventDispatcher.internalLoop
> (EventDispatcher.java:207)
>         at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
> 101)
>         at com.google.net.rpc.RpcService.runUntilServerShutdown
> (RpcService.java:251)
>         at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run
> (JavaRuntime.java:392)
>         at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ArrayStoreException: [Ljava.lang.String;
>         at java.io.ObjectInputStream.readArray(Unknown Source)
>         at java.io.ObjectInputStream.readObject0(Unknown Source)
>         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
>         at java.io.ObjectInputStream.readSerialData(Unknown Source)
>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>         at java.io.ObjectInputStream.readObject0(Unknown S

[appengine-java] PDF Generator Library

2009-09-23 Thread mably

Does anybody know of a java PDF generator library working with Google
App Engine ?  Even a low-level one.

Any help would be greatly appreciated.

Thanx in advance.

Francois
Bordeaux, FRANCE
--~--~-~--~~~---~--~~
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-java@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: Seeing different (incorrect?) JDO behavior after upgrading to 1.2.5

2009-09-23 Thread Patrizio Munzi




Another, I think important, information about the same problem,
the children fields doesn't show up even in the admin console.

I'm posting here my code so that everyone could check it out.

-- Parent
Class ---
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class User implements IsSerializable {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
    private String encodedKey;

    @Persistent
    private String userId;

    @Persistent(embedded="true", defaultFetchGroup="true")
    private Stat stat;

    public User() {}

    public String getEncodedKey() {
        return this.encodedKey;
    }

    public void setEncodedKey(String encodedKey) {
        this.encodedKey = encodedKey;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserId() {
        return userId;
    }
    
    public Stat getStat() {
        return stat;
    }

    public void setStat(Stat stat) {
        this.stat = stat;
    }

}

 Child Class 
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Stat implements GeneralStat {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
    private String encodedKey;

    @Persistent(mappedBy = "stat")
    private User user;    

    @Persistent
    private String userId;

    public Stat() {}
    
    public String getEncodedKey() {
        return encodedKey;
    }

    public void setEncodedKey(String encodedKey) {
        this.encodedKey = encodedKey;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    } 
}   

- Code Snippet not working --
PersistenceManager pm = PMF.get().getPersistenceManager();
String userId = "test";
Key userKey = KeyFactory.createKey(User.class.getSimpleName(), userId);
String userEncodedKey = KeyFactory.keyToString(userKey);
User user = new User();
user.setUserId(userId);
user.setEncodedKey(userEncodedKey);
String statEncodedKey =
KeyFactory.keyToString(userKey.getChild(Stat.class.getSimpleName(),
userId));
Stat stat = new Stat();
stat.setUserId(userId);
stat.setEncodedKey(statEncodedKey);
user.setStat(stat);
pm.makePersistent(stat);
pm.makePersistent(user);
pm.close();
        
pm = PMF.get().getPersistenceManager();
        
user = pm.getObjectById(User.class, userEncodedKey);
Stat stat = user.getStat();
-

I think I'm doing a very basic thing: persist a one-to-one
bidirectional relationship.

Am I doing something wrong??

I can't really get it work...
Please help..!!

Thanks


patrizio.munzi wrote:

  Hi,

I'm having the same problem...

When I try to fetch an object all its children fields are null.
I tried to set defaultFetchGroup = "true" but nothing changed...

Is there any work around for this???

I wouldn't want to pass to an unowned relationship...

Thanks

On Sep 16, 11:35 pm, "Jason (Google)"  wrote:
  
  
Hi bysse. You only need to create custom indexes for composite queries, i.e.
queries with two or more sort orders or queries with an equality filter on
one property and an inequality filter on another. All single-property
indexes are created by App Engine automatically, aside from Text and Blob
fields and fields you explicitly mark as unindexed.

I started seeing the same warning myself, although the end result was
exactly what I wanted. This seems to only affect owned relationships -- if
you're storing a Blob field or any other binary data, you should be able to
continue using the defaultFetchGroup parameter; I'll have to follow up to
see if there are any consequences to using this for owned relationships
given that the datastore is returning the correct result. You can also nix
the parameter and call something like getItemValues() before you close the
PersistenceManager, which will also give the intended result without the
warning.

- Jason

On Mon, Sep 14, 2009 at 12:01 PM, bysse  wrote:



  I'm having the same problem.
If i understand this correctly i must create an index for all fields
in an entity. Otherwise it will be null when i fetch the entity?
  


  If i set defaultFetchGroup = "true" i get this message which doesn't
look promising:
  


  8:55:05,144 WARN  [DataNucleus.MetaData] - Meta-data warning for
Item.values: The datastore does not support joins and therefore ca

[appengine-java] Re: not able to send emails using google apps engine

2009-09-23 Thread vikceo

Hie

thanks for replying but that does not work.

I tried it from scratch as well. I assigned one of my user in my
google apps account as administrator.
Using the same id in from still throws unauthorized user exception.

The only id i can use is the id i use to log in to the dashboard of my
google app engine account.
So, how to add more ids and provide admin right?

Vik


On Sep 22, 7:25 pm, GregGG  wrote:
> I think you have to add that "from" user as an administrative user on
> your app engine application.
>
> On Sep 22, 2:02 am, Vik  wrote:
>
>
>
> > Hie
> > Getting following exception:
>
> > javax.mail.MessagingException: Illegal Arguments
> > (java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized
> > sender
>
> > The from address is on of the user i have created in my google apps
> > account associated with my domainwww.sakshum.com
>
> > the from id i m using is subscr...@sakshum.com
>
> > So, how to fix this? I may like to use different from ids depending
> > upon the context in which a request is raised in my app.
>
> > Thankx and Regards
>
> > Vik
> > Founderwww.sakshum.comwww.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-java@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: Lists not being saved with JDO

2009-09-23 Thread Nicolas Melendez
when you do an operation with the list, for example, a get().. the data will
appear, because it is "on Demand".try it,
bye
NM

On Wed, Sep 23, 2009 at 1:56 PM, T_even  wrote:

>
> Hey,
>
> I am executing a query after i have saved the object to check if all
> the data is saved/restored.
> Right now i am using a work around, instead of letting the engine take
> care of the list i am serializing the list myself and saving them in a
> byte array. It isn't pretty but it is working. Also i have just
> checked the http://localhost:8080/_ah/admin (hadn't used it before
> today)and from what i saw the data is there so i guess the data is
> being saved but not converted back ? There query is the same for both
> versions (the work around and the normal one).
>
> I don't know if this info will be relevant but i am using eclipse
> 64bits with windows 7 64bits, eclipse is running on the 64bits jdk but
> the project is running on a 32bits jdk. I am using the 32bit jdk for
> the project because otherwise i will get an error with the google app
> engine emulator.
> >
>

--~--~-~--~~~---~--~~
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-java@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] regarding null pointer exception

2009-09-23 Thread anu

Hi every body,

  iam develpoing a sample application for login form with
validations and persist the data by using googleappengine with java
using eclipse.but iam getting the null pointer exception at the time
of running.plz any one tell me the solution.
my code is
registe.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>

<%@ page import="java.util.ArrayList" %>

<%@ page import="javax.jdo.PersistenceManager" %>

<%@ page import="javax.jdo.Query" %>

<%@ page import="com.google.org.*" %>




function button_actions()
{
  var flag=0;
  var errors="";

  if(!document.my_form.first_name.value)
  {
   alert("you need to supply your first name");
document.my_form.first_name.focus();
return false;
  }
  if(!document.my_form.last_name.value)
  {
   alert("you need to supply your last name");
document.my_form.last_name.focus();
return false;
  }

var id = document.my_form.email.value;
var re = /^...@.+\..{2,4}$/gi;
if(!id.match(re))
 {
flag++;
errors = errors + "E-Mail\n";

 }
   if(flag > 0)
{
alert("invalid email adress\n"+
errors+"\nPlease re-enter email-id.");
return 0;
}


   if(!document.my_form.user_password.value)
 {
alert("you need to supply your passsword");
 document.my_form.user_password.focus();
 return false;
 }


}



 


 
  
example
  
 


 new entry


 
   
   First Name
   

   LastName
   

   Email
   

   password
   

   confirm password
   

   

   
 
   
entries
   

 
   <%
List entries= new ArrayList();
PersistenceManager pm=PMF.get().getPersistenceManager();
Query query=pm.newQuery("SELECT FROM " +entry.class.getName());
entries=(List) query.execute();

   %>
  <%
if(entries.isEmpty()) {
   %>

   <%
   }
   else {
   %>

<%
  for(entry e:entries){
%>

   <%=e.getEmail()%>
   Quantity is<%=e.getUser_password()%>

<%
}
}
%>
 

  





web.xml:


Shop2
com.google.org.Shop2Servlet


Shop2
/shop2


shop2.jsp





enty.java

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class entry {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
private String first_name;
@Persistent
private String last_name;
@Persistent
private String email;
@Persistent
private String user_password;
@Persistent
private String confirm_password;
public entry(String email,String user_password)
{
this.email= email;
this.user_password= user_password;

}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/*public String getFirst_name() {
return first_name;
}
public void setFirst_name(String firstName) {
first_name = firstName;
}
public String getLast_name() {
return last_name;
}
public void setLast_name(String lastName) {
last_name = lastName;
}*/
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUser_password() {
return user_password;
}
public void setUser_password(String userPassword) {
user_password = userPassword;
}
/*public String getConfirm_password() {
return confirm_password;
}
public void setConfirm_password(String confirmPassword) {
confirm_password = confirmPassword;
}*/

}


pmf.java
package com.google.org;



import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {
private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-
optional");

private PMF() {}

public static PersistenceManagerFactory get() {
return pmfInstance;
}
}

register.java

package com.google.org;

import java.io.IOException;
import javax.servlet.http.*;
import javax.servlet.*;
import java.util.*;
import java.io.*;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;


@SuppressWarnings("serial")
public class Register2Servlet exten

[appengine-java] Re: Lists not being saved with JDO

2009-09-23 Thread T_even

Hey,

I am executing a query after i have saved the object to check if all
the data is saved/restored.
Right now i am using a work around, instead of letting the engine take
care of the list i am serializing the list myself and saving them in a
byte array. It isn't pretty but it is working. Also i have just
checked the http://localhost:8080/_ah/admin (hadn't used it before
today)and from what i saw the data is there so i guess the data is
being saved but not converted back ? There query is the same for both
versions (the work around and the normal one).

I don't know if this info will be relevant but i am using eclipse
64bits with windows 7 64bits, eclipse is running on the 64bits jdk but
the project is running on a 32bits jdk. I am using the 32bit jdk for
the project because otherwise i will get an error with the google app
engine emulator.
--~--~-~--~~~---~--~~
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-java@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] JDO bug - won't persist parent class attributes - has it been fixed?

2009-09-23 Thread Cornel

I remember there was a bug denoted somewhere in the documentation
(http://code.google.com/appengine/docs/java/datastore ) that JDO won't
persist properties/attributes of the parent classes. Has this been
fixed in the latest release?

--
Corneliu
--~--~-~--~~~---~--~~
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-java@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] JDO bug - won't persist parent class attributes - has it been fixed?

2009-09-23 Thread Corneliu Paul Lupulet
I remember there was a bug denoted somewhere in the documentation  *
(http://code.google.com/appengine/docs/java/datastore*)
that JDO won't persist properties/attributes of the parent classes.
Has
this been fixed in the latest release?

-- 
Corneliu Paul Lupulet

--~--~-~--~~~---~--~~
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-java@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: JDO vs low level API

2009-09-23 Thread datanucleus

> JDO limits the great flexibility of datastore, I don't understand why
> Google advises agains low-level API.

So I repeat my question to you that I raised to the previous
poster ... why not give examples of what you mean here? If you think
some low level feature is not supported why not define what it is etc,
and that way the JDO (and JPA depending on how it fits with that
standard) layer can be updated to support it also.

--Andy (DataNucleus)
--~--~-~--~~~---~--~~
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-java@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: How to location my service in Unit testing?

2009-09-23 Thread leszek

You need to have your data access method separated from servlet code
or RPC (if GWT is used) code.

Assume that you have something like:

class Customer  {

  private Key customerId;
...
}

class MyDataAccessService {

  public void addCustomer(Customer c) {
  ...
  }

and you want to test it.

You can create separate project for test (and link sources with main
project) or you can have test packages together with the main project.

So you write your test case (assuming Junit4)

public class TestCase1  {

  ...
  @Test
  public void testAddingCustomer() {
Customer c = new Customer();
c.setCustomerId("google");
...
MyDataAccessService service = new MyDataAccessService();
service.addCustomer(c);
// now test
PersistenceManager pm = ...
Customer c1 = pm.getObjectById(Customer.class, "google");
assertNotNull(c1);
assertEquals("google",c1.getCustomerId);
..
}

Now you want to have this test enabled for local Google App Engine
environment.

Create classes us described under link and fix your test case.

http://code.google.com/appengine/docs/java/howto/unittesting.html

public class TestCase1 extends LocalDatastoreTestEnvironment {

   @Before
   public void setUp() {
 super.setUp();
   }

   @After
   public void tearDown() {
 super.tearDown();
   }

   @Test
   public void testAddingCustomer() {
   ..


}

Now you can run TestCase1 as standard Junit Test (from Eclipse) and be
happy.

Addtional remark:
You can avoid extending your TestCase and use simple composition.

class TestCase {


   LocalDatastoreTestEnvironment localStore = new
LocalDatastoreTestEnvironment();

   @Before
   public void setUp() {
 localStore.setUp();
   }

   @After
   public void tearDown() {
 localStore.tearDown();
   }

Also you can change it anyway as you like and best fit to your
purpose.

Treat what is under link as a demo how this stuff is running, not as a
dogma.


--~--~-~--~~~---~--~~
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-java@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: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread datanucleus

> BigTable simply is not a relational db, so it is highly misleading to
> fake a relational wrapper and to me it caused lots of pain.

Apart from the fact that JDO is not a "relational wrapper". The API
and metadata are object-based; only a subset of metadata is specific
to "mapped" datastores and this is marked clearly in the (DataNucleus)
docs.

As ever, if you have some specific issue to raise why not define it -
e.g something that can be done in the low level API that can't be done
via a generic 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-java@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: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread Erdinc Yilmazel
+1 Definitely.

On Wed, Sep 23, 2009 at 10:53 AM, Mingfai  wrote:

>
>
> On Wed, Sep 23, 2009 at 5:40 PM, dflorey  wrote:
>
>>
>> I've just refactored my app to use Low-Level API instead of JDO and
>> it's much cleaner, works more reliable etc.
>> If you are not really forced to use JDO/JPA I'd strongly recommend to
>> use the very simple, elegant and clean Low-Level API.
>> BigTable simply is not a relational db, so it is highly misleading to
>> fake a relational wrapper and to me it caused lots of pain.
>>
>>
> +1, this is my approach too.
>
>
> >
>

--~--~-~--~~~---~--~~
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-java@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: My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread Mingfai
On Wed, Sep 23, 2009 at 5:40 PM, dflorey  wrote:

>
> I've just refactored my app to use Low-Level API instead of JDO and
> it's much cleaner, works more reliable etc.
> If you are not really forced to use JDO/JPA I'd strongly recommend to
> use the very simple, elegant and clean Low-Level API.
> BigTable simply is not a relational db, so it is highly misleading to
> fake a relational wrapper and to me it caused lots of pain.
>
>
+1, this is my approach too.

--~--~-~--~~~---~--~~
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-java@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] My recommendation: Use Low-Level API instead of JDO/JPA

2009-09-23 Thread dflorey

I've just refactored my app to use Low-Level API instead of JDO and
it's much cleaner, works more reliable etc.
If you are not really forced to use JDO/JPA I'd strongly recommend to
use the very simple, elegant and clean Low-Level API.
BigTable simply is not a relational db, so it is highly misleading to
fake a relational wrapper and to me it caused lots of pain.
--~--~-~--~~~---~--~~
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-java@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: Seeing different (incorrect?) JDO behavior after upgrading to 1.2.5

2009-09-23 Thread patrizio.munzi

Hi,

I'm having the same problem...

When I try to fetch an object all its children fields are null.
I tried to set defaultFetchGroup = "true" but nothing changed...

Is there any work around for this???

I wouldn't want to pass to an unowned relationship...

Thanks

On Sep 16, 11:35 pm, "Jason (Google)"  wrote:
> Hi bysse. You only need to create custom indexes for composite queries, i.e.
> queries with two or more sort orders or queries with an equality filter on
> one property and an inequality filter on another. All single-property
> indexes are created by App Engine automatically, aside from Text and Blob
> fields and fields you explicitly mark as unindexed.
>
> I started seeing the same warning myself, although the end result was
> exactly what I wanted. This seems to only affect owned relationships -- if
> you're storing a Blob field or any other binary data, you should be able to
> continue using the defaultFetchGroup parameter; I'll have to follow up to
> see if there are any consequences to using this for owned relationships
> given that the datastore is returning the correct result. You can also nix
> the parameter and call something like getItemValues() before you close the
> PersistenceManager, which will also give the intended result without the
> warning.
>
> - Jason
>
> On Mon, Sep 14, 2009 at 12:01 PM, bysse  wrote:
>
> > I'm having the same problem.
> > If i understand this correctly i must create an index for all fields
> > in an entity. Otherwise it will be null when i fetch the entity?
>
> > If i set defaultFetchGroup = "true" i get this message which doesn't
> > look promising:
>
> > 8:55:05,144 WARN  [DataNucleus.MetaData] - Meta-data warning for
> > Item.values: The datastore does not support joins and therefore cannot
> > honor requests to place child objects in the default fetch group.  The
> > field will be fetched lazily on first access.  You can modify this
> > warning by setting the datanucleus.appengine.ignorableMetaDataBehavior
> > property in your config.  A value of NONE will silence the warning.  A
> > value of ERROR will turn the warning into an exception.
>
> > Should i just set this property and ignore the warning?
>
> > /Erik
>
> > On Sep 8, 8:56 pm, "Jason (Google)"  wrote:
> > > Hi David. I believe this is expected behavior -- unindexed properties,
> > > including Text, Blob, and reference properties as well as descendants
> > > (PrivilegedUser in this case) are not retrieved by default. There is an
> > > easier way to add a field to the default fetch group:
>
> > > @Persistent(defaultFetchGroup = "true")
> > > private PrivilegedUser privilegedUser;
>
> > > Can you let me know if this works for you? If not, can you share your
> > > PrivilegedUser class definition?
>
> > > - Jason
>
> > > On Fri, Sep 4, 2009 at 9:56 PM, David  wrote:
>
> > > > I’ve been working with a fairly simple data model that has an
> > > > Organization object which contains some String members as well as a
> > > > member variable of type PrivilegedUser.  And PrivilegedUser extends a
> > > > User, and contains only a Key and some String members.
>
> > > > @PersistenceCapable(identityType = IdentityType.APPLICATION,
> > > > detachable="true")
> > > > public class Organization implements Serializable {
>
> > > >       �...@primarykey
> > > >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > > >        private Long id;
>
> > > >       �...@persistent
> > > >    private String organizationId;
>
> > > >   �...@persistent
> > > >    private String organizationName;
>
> > > >   �...@persistent
> > > >     private PrivilegedUser privilegedUser;
>
> > > > ….
>
> > > > I have code running successfully under 1.2.2 which creates an
> > > > Organization, then creates a Privileged User object, and assigns it to
> > > > the Organization, and then makes the Organization persistent.
> > > > Later I query by organizationId to retrieve the Organization object,
> > > > and update the PrivilegedUser on the Organization object.
> > > > This works fine under 1.2.2.
>
> > > > Under 1.2.5 I began getting the following error:
> > > > You have just attempted to access field "privilegedUser" yet this
> > > > field was not detached when you detached the object. Either dont
> > > > access this field, or detach it when detaching the object.
>
> > > > However, after stepping through the debugger I believe the root cause
> > > > is that the privilegedUser field is null on the Organization object
> > > > returned from the query (the String members are still correct).  This
> > > > value is null even before I attempt to detach the Organization object
> > > > from the PersistenceManager.
>
> > > > After seeing this behavior I modified the query code I had been using
> > > > to include a custom fetch plan for the query.
> > > > This did not change the behavior under 1.2.5.
>
> > > >               PersistenceManager pm = PMF.get().getPersistenceManager
> > > > ();
>
> > > >                FetchGroup fetchGroup =
>

[appengine-java] gql query error on data viewer.. help

2009-09-23 Thread mar_novice

When i use a filter in query like
SELECT * FROM Fruits where item = 'apple'

It runs well and if i use an ordering like
SELECT * FROM Subscriber order by date

it runs well also

but when i combine the two,

SELECT * FROM Fruits where item = 'apple' order by date

i got Server Error..

What do you think is the problem??

thanks..

mar_novice
--~--~-~--~~~---~--~~
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-java@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] strange behavior of one-to-one owned (one-direction) relationship

2009-09-23 Thread Patrizio Munzi





Hi everybody,

I'm trying to model a one-to-one owned (one-direction) relationship,
where the owned object (Stat) is created inside the owner (User).

---
public class User
implements IsSerializable {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
    private String encodedKey;

    @Persistent
    private String userId;

    @Persistent
    private Stat stat= new Stat();

    public User() {}

    public String getEncodedKey() {
        return this.encodedKey;
    }

    public void setEncodedKey(String encodedKey) {
        this.encodedKey = encodedKey;
       
stat.setEncodedKey(KeyFactory.keyToString(KeyFactory.stringToKey(encodedKey).getChild(Stat.class.getSimpleName(),
userId)));
    }

    public void setUserId(String userId) {
        this.userId = userId;
        stat.setUserId(userId);
    }

    public String getUserId() {
        return userId;
    }

    public void updateStat(long number) {
        stat.updateStat(number);
    }

    public Stat getStat() {
        return stat;
    }
}


this implementation however produces a strange behaviour.
Every time I try to access the User entity a new Stat object is created
into the datastore:
For example this call will create an object even if the user object
doesn't exist:

User user = pm.getObjectById(User.class, userEncodedKey);

Am I using the one-to-one relationship in a wrong way???

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-java@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: excel to datatstore.. help

2009-09-23 Thread mar_novice

Ahhh.. I see.. got it.. thanks.

On Sep 23, 3:28 pm, datanucleus  wrote:
> > i'm confused.. which plug-in again should i use?? looking at the excel
> > plugin doc, it only tells how to get data from java objects to excel..
> > but i cant find how to get data from excel so that i can persist it to
> > the datastore.
>
> The datanucleus-excel plugin supports persistence/retrieval from Excel
> (just like the datanucleus-google plugin supports persistence/
> retrieval for Google BigTable). You use the JDO API as normal but with
> a PMF for that Excel "datastore" and retrieve your objects, and detach
> them. You then persist those detached objects to the PMF for the
> Google "datastore". Easy
--~--~-~--~~~---~--~~
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-java@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] log page gets unformatted when looking at older logs

2009-09-23 Thread mar_novice

When looking at olders logs by clicking Next 20> the page gets
unformatted and not good to look at.. i am using firefox 3.0 in
ubuntu
--~--~-~--~~~---~--~~
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-java@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: excel to datatstore.. help

2009-09-23 Thread datanucleus

> i'm confused.. which plug-in again should i use?? looking at the excel
> plugin doc, it only tells how to get data from java objects to excel..
> but i cant find how to get data from excel so that i can persist it to
> the datastore.

The datanucleus-excel plugin supports persistence/retrieval from Excel
(just like the datanucleus-google plugin supports persistence/
retrieval for Google BigTable). You use the JDO API as normal but with
a PMF for that Excel "datastore" and retrieve your objects, and detach
them. You then persist those detached objects to the PMF for the
Google "datastore". Easy
--~--~-~--~~~---~--~~
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-java@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
-~--~~~~--~~--~--~---