Hello people, i'm getting problems with Slices again, now i have to bring the
results of only one database, look:

        String db = "ONE";
        String hint = "openjpa.hint.slice.Target";
        

        Properties props = new Properties();
        EntityManagerFactory factory =
Persistence.createEntityManagerFactory("PersistenceUnit", props);

        EntityManager em = factory.createEntityManager();

        Query query = em.createQuery("SELECT c FROM Cliente c WHERE c.email
= :email AND c.senha = :senha").setHint(hint, db);
        query.setParameter("email", email);
        query.setParameter("senha", senha);

        @SuppressWarnings("unchecked")
        List<Cliente> lista = query.getResultList();

        if(lista.size() > 0) {
            Object cliente = lista.get(0);
            retorno = Utility.toJSON(cliente);
        } else {
            retorno = Configuracao.ErrorMessage;
        }


I put the Slice "ONE", but when i remove the "hint" clause the result comes
for me, but i know that at least one result have to return in this query, i
don't know what i'am doing wrong...

tks!



-- 
View this message in context: 
http://n2.nabble.com/Targeted-Query-in-Slices-tp1580324p1580324.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to