Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Could not create query metamodel for method

$
0
0
Hi,

I have an error with Spring Data unable to parse my method name derivation query:
Code:

public Page<AdminModule> findByAdminOrderByModule(Admin admin, Pageable page);
The data model is:
Code:

@Entity
public class AdminModule extends AbstractEntity {

    @Column(nullable = false, length = 50)
    private String module;
    @ManyToOne
    @JoinColumn(name = "admin_id", nullable = false)
    private Admin admin;

    public AdminModule() {
    }

    public Admin getAdmin() {
        return this.admin;
    }

    public void setAdmin(Admin admin) {
        this.admin = admin;
    }

    public String getModule() {
        return this.module;
    }

    public void setModule(String module) {
        this.module = module;
    }

}

@Entity
public class Admin extends AbstractEntity {

    @Column(nullable = false)
    private String firstname;
    @Column(nullable = false)
    private String lastname;
    @Column(nullable = false, unique = true, length = 50)
    private String login;
    @Column(nullable = false, length = 100)
    private String password;
    @Column(nullable = false, length = 50)
    private String passwordSalt;
    @Column(nullable = false)
    private boolean superAdmin;
    @Column(nullable = false)
    private boolean preferenceAdmin;
    private String address;
    @Column(length = 10)
    private String zipCode;
    private String city;
    private String country;
    @Column(nullable = false)
    private String email;
    @Lob
    @Column(columnDefinition = "TEXT", length = 65535)
    private String profile;
    private String postLoginUrl;

    public Admin() {
    }

    public String getFirstname() {
        return this.firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return this.lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getLogin() {
        return this.login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPasswordSalt() {
        return passwordSalt;
    }

    public void setPasswordSalt(String passwordSalt) {
        this.passwordSalt = passwordSalt;
    }

    public boolean getSuperAdmin() {
        return this.superAdmin;
    }

    public void setSuperAdmin(boolean superAdmin) {
        this.superAdmin = superAdmin;
    }

    public boolean getPreferenceAdmin() {
        return this.preferenceAdmin;
    }

    public void setPreferenceAdmin(boolean preferenceAdmin) {
        this.preferenceAdmin = preferenceAdmin;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipCode() {
        return this.zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getCity() {
        return this.city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return this.country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getProfile() {
        return this.profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public String getPostLoginUrl() {
        return postLoginUrl;
    }

    public void setPostLoginUrl(String postLoginUrl) {
        this.postLoginUrl = postLoginUrl;
    }

}

The error shows in the console during the Maven build:
Quote:

Could not create query metamodel for method public abstract org.springframework.data.domain.Page com.thalasoft.learnintouch.core.jpa.repository.Adm inModuleRepository.findByAdminOrderByModule(com.th alasoft.learnintouch.core.jpa.domain.Admin,org.spr ingframework.data.domain.Pageable)!
Any clue ?

Thanks.

Viewing all articles
Browse latest Browse all 297

Trending Articles