Skip to content

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

@rmpestano

Description

@rmpestano
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions