services.FlexPeopleService Maven / Gradle / Ivy
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package services;
import db.Person;
import java.util.HashMap;
import javax.ejb.Stateless;
import org.neo4j.ogm.cypher.query.SortOrder;
import utils.DatabaseUtils;
/**
*
* @author zua
*/
@Stateless
public class FlexPeopleService extends AbstractDBService implements FlexPeopleServiceInterface {
public FlexPeopleService() {
}
@Override
public Person findPersonNamed(String name) {
String query = "MATCH (n:Person) WHERE n.name="
+ DatabaseUtils.getInstance().wrapUp(name)
+ " RETURN n";
return getSession().queryForObject(Person.class, query, new HashMap<>());
}
@Override
public Class getClassType() {
return Person.class;
}
@Override
public SortOrder getSortOrderAsc() {
return new SortOrder().add(SortOrder.Direction.ASC, "name");
}
@Override
public SortOrder getSortOrderDesc() {
return new SortOrder().add(SortOrder.Direction.DESC, "name");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy