br.com.anteros.nosql.persistence.mongodb.session.service.MongoSimpleService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-NoSql-Persistence-MongoDB Show documentation
Show all versions of Anteros-NoSql-Persistence-MongoDB Show documentation
Anteros NoSQL Persistence MongoDB.
package br.com.anteros.nosql.persistence.mongodb.session.service;
import br.com.anteros.nosql.persistence.mongodb.query.MongoCriteria;
import br.com.anteros.nosql.persistence.mongodb.query.MongoQuery;
import br.com.anteros.nosql.persistence.mongodb.query.rsql.visitor.ComparisonToCriteriaConverter;
import br.com.anteros.nosql.persistence.mongodb.query.rsql.visitor.RsqlMongoAdapter;
import br.com.anteros.nosql.persistence.mongodb.session.repository.MongoSimpleRepository;
import br.com.anteros.nosql.persistence.session.NoSQLSessionFactory;
import br.com.anteros.nosql.persistence.session.query.NoSQLQuery;
import br.com.anteros.nosql.persistence.session.query.Page;
import br.com.anteros.nosql.persistence.session.query.Pageable;
import br.com.anteros.nosql.persistence.session.repository.NoSQLRepository;
import br.com.anteros.nosql.persistence.session.service.AbstractSimpleService;
public class MongoSimpleService extends AbstractSimpleService {
private Class entityClass;
public MongoSimpleService(NoSQLSessionFactory sessionFactory) {
super(sessionFactory);
}
public MongoSimpleService() {
}
@Override
protected NoSQLRepository doGetDefaultRepository(NoSQLSessionFactory sessionFactory, Class entityClass) {
this.entityClass = entityClass;
return new MongoSimpleRepository(sessionFactory, entityClass);
}
@Override
public NoSQLQuery> parseRsql(String rsql) {
RsqlMongoAdapter adapter = new RsqlMongoAdapter(new ComparisonToCriteriaConverter());
MongoCriteria criteria = (MongoCriteria) adapter.getCriteria(rsql, entityClass);
return MongoQuery.of(criteria);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy