-
Notifications
You must be signed in to change notification settings - Fork 50
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
Bug found by using Videoshop: Using Spring data for Ordering #151
Comments
The log message you see "should" appear whether you try the above code or not. It's a glich in HIbernate that has been reported before that shouldn't be affecting the actual functionality of the application. I am not quite getting the first part of your report. What's the actual problem? Do you get an exception?
|
That Than i reformat my question a little bit. Can i sort over the Price using spring data. So that |
This came up in the tutors' meeting today. Once we move to discs.findByType(type).stream()
.sorted(Disc.BY_PRICE) // that being a Comparator.comparing(Disc::getPrice)
.collect(Collectors.toList()) That could even be hidden inside a default method in e.g. VideoShop's Another option would be to Jadira Usertypes and its support for Moneta. We'd have to explore how intensive the ripple effects of that are. Every /cc @martinmo |
I think the first options is a good intermediate solution. It could be included in a minor release, existing code should work without changes after a recompile ( Have not looked into Jadira Usertypes yet :-/ how does "equipping" a field with it look like? Is it just an annotation? |
Try to use Spring data for sorting.
Iterable<Disc> findAllByOrderByPriceAsc();
Attribute price uses
javax.money.MonetaryAmount
At start log notification shows the possible problem with MonetaryAmount
2016-11-14 14:34:01.317 WARN 1410 --- [ restartedMain] o.h.t.d.java.JavaTypeDescriptorRegistry : Could not find matching type descriptor for requested Java class [javax.money.MonetaryAmount]; using fallback
The text was updated successfully, but these errors were encountered: