Re: GWT + JDO (GAE)

2010-11-07 Thread Didier Durand
Hi Caio,

You should post this in Google App Engine group: better chance for
responses.

regards
didier

On Nov 7, 2:42 am, Caio caio.nery1...@yahoo.com.br wrote:
 Hello, guys.

 I've been using JDO these weeks. I've followed the tutorial at GAE
 Docs, and I learned how to create and get entity objects.

 I've created a class 'User' for my system. This class has the
 attributes username(String), password(String), isOnline(boolean) and
 score(int).

 I've succeeded at updating the isOnline attribute, but when I tried to
 update the score attribute, I've failed. The return value of the
 setter is always true, but the score value is not updated. Could you
 give any help?

 @Override

 public boolean setScore(String userName, int increment) {

 PersistenceManager pm = PMF.get().getPersistenceManager();

 Transaction tx = pm.currentTransaction();

 User user;

 boolean returnValue;

 try {

 tx.begin();

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

 //--detaching-attaching

 pm.makePersistent(user);

 User auxUser = (User) pm.detachCopy(user);

 auxUser.setScore(increment);

 pm.makePersistent(auxUser);

 returnValue = true;

 tx.commit();

 //--detaching-attaching

 } catch (NullPointerException ex) {

 returnValue = false;

 } catch (JDOObjectNotFoundException ex) {

 user = null;

 returnValue = false;

 } finally {

 if (tx.isActive()) {

 tx.rollback();

 }

 pm.close();

 }

 return returnValue;

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT + JDO (GAE)

2010-11-07 Thread Shawn Brown
 Hi,

 I've been using JDO these weeks. I've followed the tutorial at GAE
 Docs, and I learned how to create and get entity objects.

It just my opinion based on struggling with JDO that objectify is much
easier to use.  Much much much easier.

http://code.google.com/p/objectify-appengine/

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT + JDO (GAE)

2010-11-07 Thread Jeff Schwartz
+1

On Sun, Nov 7, 2010 at 5:46 AM, Shawn Brown big.coffee.lo...@gmail.comwrote:

  Hi,

  I've been using JDO these weeks. I've followed the tutorial at GAE
  Docs, and I learned how to create and get entity objects.

 It just my opinion based on struggling with JDO that objectify is much
 easier to use.  Much much much easier.

 http://code.google.com/p/objectify-appengine/

 Shawn

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




-- 
Jeff

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT + JDO (GAE)

2010-11-07 Thread nacho
+1

On 7 nov, 11:17, Jeff Schwartz jefftschwa...@gmail.com wrote:
 +1

 On Sun, Nov 7, 2010 at 5:46 AM, Shawn Brown big.coffee.lo...@gmail.comwrote:



   Hi,

   I've been using JDO these weeks. I've followed the tutorial at GAE
   Docs, and I learned how to create and get entity objects.

  It just my opinion based on struggling with JDO that objectify is much
  easier to use.  Much much much easier.

 http://code.google.com/p/objectify-appengine/

  Shawn

  --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

 --
 Jeff

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT + JDO (GAE)

2010-11-07 Thread Didier Durand
Hi,

Also agree about Objectify: use it with great satisfaction.
didier

On Nov 7, 11:46 am, Shawn Brown big.coffee.lo...@gmail.com wrote:
  Hi,

  I've been using JDO these weeks. I've followed the tutorial at GAE
  Docs, and I learned how to create and get entity objects.

 It just my opinion based on struggling with JDO that objectify is much
 easier to use.  Much much much easier.

 http://code.google.com/p/objectify-appengine/

 Shawn

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



GWT + JDO (GAE)

2010-11-06 Thread Caio
Hello, guys.

I've been using JDO these weeks. I've followed the tutorial at GAE
Docs, and I learned how to create and get entity objects.

I've created a class 'User' for my system. This class has the
attributes username(String), password(String), isOnline(boolean) and
score(int).

I've succeeded at updating the isOnline attribute, but when I tried to
update the score attribute, I've failed. The return value of the
setter is always true, but the score value is not updated. Could you
give any help?


@Override

public boolean setScore(String userName, int increment) {

PersistenceManager pm = PMF.get().getPersistenceManager();

Transaction tx = pm.currentTransaction();

User user;

boolean returnValue;


try {

tx.begin();

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

//--detaching-attaching

pm.makePersistent(user);

User auxUser = (User) pm.detachCopy(user);

auxUser.setScore(increment);

pm.makePersistent(auxUser);

returnValue = true;

tx.commit();

//--detaching-attaching

} catch (NullPointerException ex) {

returnValue = false;

} catch (JDOObjectNotFoundException ex) {

user = null;

returnValue = false;

} finally {

if (tx.isActive()) {

tx.rollback();

}

pm.close();

}

return returnValue;

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.