Announcement Announcement Module
Collapse
No announcement yet.
Why public Admin findByLoginAndPassword(String login, String password) has limit 2 ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why public Admin findByLoginAndPassword(String login, String password) has limit 2 ?

    Hello,

    I have a query defined by its method signature in an interface:

    public Admin findByLoginAndPassword(String login, String password)

    It gives the following sql statement:

    select admin0_.id as id14_, admin0_.address as address14_, admin0_.city as city14_, admin0_.country
    as country14_, admin0_.email as email14_, admin0_.firstname as firstname14_, admin0_.lastname
    as lastname14_, admin0_.login as login14_, admin0_.password as password14_, admin0_.password_salt
    as password10_14_, admin0_.post_login_url as post11_14_, admin0_.preference_admin as preference12_14_,
    admin0_.profile as profile14_, admin0_.super_admin as super14_14_, admin0_.version as version14_,
    admin0_.zip_code as zip16_14_ from admin admin0_ where admin0_.login='stephane' and admin0_.password='toto'
    limit 2

    I wonder why is there a limit 2 and where it's coming from.

    I'm using Hibernate 3.6.9.Final and Spring Data 1.3.0.RELEASE

  • #2
    I wanted to have a limit 1 on it but could not find any way to specify it, so did not specify anything, and was surprised to see it defaulted to limit 2

    Comment

    Working...
    X