Here is the Espace.java, When you see comment it means that i have try
other alternative that doesn't work too :

package com.phonitive.isalon.model;

import java.util.Date;

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;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Espace {
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
//  private Key key;
        private Long key;
        @Persistent
        private String coordonnee;
        @Persistent
        private String forme;
        @Persistent
        private String nom;

        @Persistent
        private Date update;

        public boolean equals(Espace obj) {

        return (obj.coordonnee.equalsIgnoreCase(this.coordonnee) &&
                        obj.forme.equalsIgnoreCase(this.forme) &&
                        obj.nom.equalsIgnoreCase(this.nom));
        }
        public Date getUpdate() {
                return update;
        }
        public void setUpdate(Date update) {
                this.update = update;
        }
        public String getCoordonnee() {
                return coordonnee;
        }
        public void setCoordonnee(String coordonnee) {
                this.coordonnee = coordonnee;
        }
        public String getForme() {
                return forme;
        }
        public void setForme(String forme) {
                this.forme = forme;
        }
        public String getNom() {
                return nom;
        }
        public void setNom(String nom) {
                this.nom = nom;
        }
        public Espace(String coordonnee, String forme, String nom) {
                super();
                this.coordonnee = coordonnee;
                this.forme = forme;
                this.nom = nom;
        }
        @JsonIgnore
        public Long getKey() {
                return key;
        }
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result
                                + ((coordonnee == null) ? 0 :
coordonnee.hashCode());
                result = prime * result + ((forme == null) ? 0 :
forme.hashCode());
                result = prime * result + ((nom == null) ? 0 :
nom.hashCode());
                result = prime * result + ((update == null) ? 0 :
update.hashCode());
                return result;
        }
        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                Espace other = (Espace) obj;
                if (coordonnee == null) {
                        if (other.coordonnee != null)
                                return false;
                } else if (!coordonnee.equals(other.coordonnee))
                        return false;
                if (forme == null) {
                        if (other.forme != null)
                                return false;
                } else if (!forme.equals(other.forme))
                        return false;
                if (nom == null) {
                        if (other.nom != null)
                                return false;
                } else if (!nom.equals(other.nom))
                        return false;
                if (update == null) {
                        if (other.update != null)
                                return false;
                } else if (!update.equals(other.update))
                        return false;
                return true;
        }
        /*public void setKey(Key key) {
                this.key = key;
        }*/

}


On Mar 31, 6:05 pm, Jake <jbrooko...@cast.org> wrote:
> Hey Guit,
>
> Could you also post the data object class code (Espace.class)?
>
> In the meantime, you can also try some debugging alternatives 
> withhttp://www.datanucleus.org/products/accessplatform_1_0/jdo/jdoql.html
> as your guide.
>
> Jake
>
> On Mar 30, 6:36 pm, Guit <lemoin...@gmail.com> wrote:
>
>
>
> > Anybody ? Someone look at my class and say to me ot should work but it
> > doesn t and i habe still no ide why ... Please :)
> > On 30 mar, 00:09, Guit <lemoin...@gmail.com> wrote:
>
> > > Hi everybody,
> > > I am trying to build my application and i am facing a very strange
> > > issue : here is the code :
> > > PersistenceManager pm=PMF.get().getPersistenceManager();
>
> > >                         Query query=pm.newQuery(Espace.class);
> > >                         //query.setFilter("nom == paramAuthor");
> > >                         //query.declareParameters("java.lang.String 
> > > paramAuthor");
> > >                         List<Espace> results ;
> > >                         results=(List<Espace>) query.execute();//"_66");
> > >                         for (int i=0;i<results.size();i++){
> > >                                 Espace es=results.get(i);
> > >                                 System.out.println(es.getNom());
> > >                         }
> > >                         return results;
> > > When i run it i obtain a long list of name :
> > > ...
> > > _65
> > > _66
> > > _67
> > > ...
>
> > > When I remove comment and execute the query , i have no result...
> > > I really don't understand why...
> > > If you have an idea... it would be very nice to help me :)
> > > Guit

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

Reply via email to