[appengine-java] javax.jdo.JDOUserException: Portion of expression could not be parsed: @email.com

2011-01-12 Thread spike
Hi..i have two fields namely login id(n...@email.com) & password. The
user on entering them will check if the user exist or not.the code is
given below:
//code
public List userLoginCheck(String login_Id,String
userPassword){

PersistenceManager pm = PMF.get().getPersistenceManager();
//System.out.println("PersistenceManager object created in
userLoginCheck()");
Query query = pm.newQuery(UserDetails.class);
//System.out.println("login_Id = "+login_Id+" userPassword =
"+userPassword);
query.setFilter("login_Id == susheel.ku...@ap.sony.com &&
userPassword == "+userPassword);

try{
//System.out.println("inside try block");
List userDetails = 
(List)
query.execute();
if (!userDetails.isEmpty()) {
for (UserDetails user_detail_obj : userDetails){
System.out.println("inside for 
loop login_Id =
"+user_detail_obj.getLoginId());
}
}

return userDetails;
}catch(Exception e){
System.out.println("Exception at 
userLoginCheck() = "+e);
}finally{
query.closeAll();
}
return null;
}

But when i execute the above code I get the following error

Exception at userLoginCheck() = javax.jdo.JDOUserException: Portion of
expression could not be parsed: @email.com && userPassword == sample
NestedThrowables:
org.datanucleus.store.query.QueryCompilerSyntaxException: Portion of
expression could not be parsed: @email.com && userPassword == sample

This error happens only if email id is used as filter. When I use any
other fields within datastore it doesnt cause any error. Please can
anyone help me out in this?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Regarding @Column annotation

2011-01-11 Thread spike
Hi,
  I have a class as shown below in my Google App engine datastore. I
need to define the size limit for the fields, like name field i want
to set a particular size-limit of 5. I tried to put @Column(length=5)
but still it is accepting names whose length is more than that. I
tried to create package.jdo and define things in that but its not
reading
from it. Doesn't Google App engine support package.jdo(code is given
below)? None of the documentation given by Google specifies anything
related to it. How can I handle the size?

//POJO code-
public class UserDetails {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key user_id;
@Persistent
@Column(length=5)
private String Name;
@Persistent
private String login_id;
@Persistent
private String userRole;
@Persistent
private String userPassword;
@Persistent
private Date creationDate;
//.


//package.jdo code..




















   









-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.