Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to create a criteria for other entities in a service #33

Closed
rmpestano opened this issue Feb 12, 2019 · 0 comments
Closed

Add ability to create a criteria for other entities in a service #33

rmpestano opened this issue Feb 12, 2019 · 0 comments
Milestone

Comments

@rmpestano
Copy link
Contributor

rmpestano commented Feb 12, 2019

Issue Overview

A service can only query its entity when using criteria support

Current Behaviour

Example in service below we can only select cars when we use criteria:


public class CarService extends CrudService<Car, Integer> implements Serializable {

       public List<Car> listByModel(String model) {
            return criteria() //the instance of criteria can only query Car entity
                .likeIgnoreCase(Car_.model, model)
                .getResultList();
    }

}
Expected Behaviour

Make it possille to pass an entity as parameter for criteria() method:

public List<SalesPoint> listSalesPointsByName(String name) {
        return criteria(SalesPoint.class)
                .likeIgnoreCase(SalesPoint_.name, "%"+name + "%")
                .getResultList();

Additional Information
  • Affected version: 1.0.2
@rmpestano rmpestano added this to the 1.0.3 milestone Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant