Expr class use in Play 2.0.1, Incompatible types

52 views
Skip to first unread message

Antoine DE PARDAILHAN

unread,
May 23, 2012, 12:11:52 PM5/23/12
to eb...@googlegroups.com
Hello there,

I am currently working on a project, where i need to work on a database and make many search. To do that, i am using the class finder and its associated expr class:

public static List<Personne> pfind(String champ) {

       return find.where()
                  .ilike("nom",  "%"+champ+"%");
     }

I have an error on compilation which i don't understand, saying "error: incompatible types", on ilike() execution. I tried to parse my champ into a char[] to fit my "nom" attribute inside my database, but i still have the same issue.

Could i have some support over here please ? :p

Thanks :)

Rob Bygrave

unread,
May 23, 2012, 5:29:07 PM5/23/12
to eb...@googlegroups.com
Are you getting a java compiler error? If so you need to provide more code ... like the definition of the find field etc.

Antoine DE PARDAILHAN

unread,
May 24, 2012, 3:32:46 AM5/24/12
to eb...@googlegroups.com
Yes i think so (this is the compilation error page from Play!). I just have a minimal code atm, and the definition of my find field is just like many tutorials :

public static Finder<String, Personne> find = new Finder<String, Personne>(String.class,Personne.class);

I had the original sample public static Finder<Long, Personne> find = new Finder<Long, Personne>(Long.class,Personne.class); None of them are working with the where clause with my "Personne" model. "Personne" has the following attributes :

     @Id
     public int id;
     public String nom;
     public String prenom;
     public String adresse;

Sorry again eventually for the lack of precision, i am not used to post on support forums :)

Rob Bygrave

unread,
May 24, 2012, 4:48:11 PM5/24/12
to eb...@googlegroups.com
I don't know if anyone on this Ebean forum is going to know the answer.

Seems to me you should be asking this question in the Play forums. Finder is not an Ebean object.

Antoine DE PARDAILHAN

unread,
May 25, 2012, 3:10:45 AM5/25/12
to eb...@googlegroups.com
In fact i tried another method, which is :

List<Personne> presult = Ebean.find(Personne.class).where().like("personne.nom", "pardailhan%");

I directly use the Ebean static object, but i still have the same error : Incompatible types ...
I join a screenshot from my error to this message.

Thanks again for you help :)
play_error.jpg

Rob Bygrave

unread,
May 25, 2012, 11:32:43 PM5/25/12
to eb...@googlegroups.com

I think you need to ask on the Play forums. It does not look like an issue a java compiler would have.

Antoine DE PARDAILHAN

unread,
May 28, 2012, 3:19:58 AM5/28/12
to eb...@googlegroups.com
Alright, thanks for your support :)
Reply all
Reply to author
Forward
0 new messages