Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

I find a bug findFirstByUserid()

when my id is 15080316325440044460 but 1508031632544004446011212 also can be found as data



11.0k
edited Nov '15

Did it find 15080316325440044460? That would be expected as you stipulated findFirst and as the lower number, that would be found first. Or did something else happen?



773

Does it find the expected one when you try findByUserid()?



12.2k
edited Nov '15

when I findFirstByUserid(15080316325440044460) and it can find the true data . but when my table no 15080316325440044460 and instead 15080316325440044460333 note last no matter what I add it can be find as findFirstByUserid(15080316325440044460) result, my Userid is char 20



11.0k

What is the column data type for the Userid ?



11.0k
Accepted
answer
edited Nov '15

So the ID 15080316325440044460 is 20 chars. 15080316325440044460333 is 23 chars (to long), so it gets truncated to 20 chars which leaves 15080316325440044460. So when you do findFirstByUserid(15080316325440044460333) the 333 is ignored from the query. You could try setting the column data type to char 23 or bigint etc.



12.2k

thanks ,unreasonable