Hi,

Hmm one month and no answers.. it seems that I am the only one with this 
problem :) 

Does anybody uses prepared statements with Object database ?

Le mardi 1 avril 2014 17:08:49 UTC+2, Emmanuel Fauré a écrit :
>
> Hi everyone, 
>
> I try to use prepared queries with object database, but it doesn't work : 
> is this supported, or is this only for document databases ?
>
> My code (without prepared query) that returns a result.
>
>
>
>
>
>
>
> *    public List<Place> searchByName(String name) {        
> OObjectDatabaseTx db = Db.instance().get();        String query="select * 
> from Place where name.toLowerCase() like '%"+name+"%'";        logger.info 
> <http://logger.info>("PlaceService.searchByName query="+query);        
> List<Place> result = db.query(new OSQLSynchQuery<Place>(query));        
> db.close();        return result;    }*
>
> My code (with prepared query) that returns no result.
>
>
>
>
>
>
>
>
>
> *public List<Place> searchByNamePrepared(String name) {        
> OObjectDatabaseTx db = Db.instance().get();        String s="select * from 
> Place where name.toLowerCase() like '%:name%'";        
> OSQLSynchQuery<Place> query= new OSQLSynchQuery<Place>(s);        
> Map<String,Object> params = new HashMap<String,Object>();        
> params.put("name", name);            List<Place> result = 
> db.command(query).execute(params);        db.close();        return 
> result;    }*
>
> My Pojo Place is basic, no annotations, juste private membres and 
> getters/setters.
> My Db class is just an abstraction of 
> OObjectDatabasePool.global().acquire(DB_URL, DB_LOGIN, DB_PASSWORD);    
>
> Thanks :)
>
> @OrientDB team : good job with this product ! 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to