-
Notifications
You must be signed in to change notification settings - Fork 45
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
No Hibernate type for Interval that lets you query with DateTime #12
Comments
Thanks for your suggestion. What change are you proposing? What problem did you face in the build? |
I'm proposing creating a new a class similar to When I attempt to build the project, using
The URL mentioned in the error is a local proxy that includes Maven Central as well as other repos. Is there a particular repo I need to be pointing too? |
Not sure about the build error, looks like it is in usertype.core. You could build the depmgmt and usertype.spi modules before reattempting the full build. |
Its a big issue and will not be implemented in Jadira for a small while. Also, you won't be able to make use of this without a database with a 4.2 driver. In (quite a long) time JPA will remove the need for some of the custom mappings, although again, it will depend on driver support. This link is very relevant as it explains the cases we need to support to evolve to the best forward compatibility: https://java.net/jira/browse/JPA_SPEC-63
NB Some more thought about the offset types in 4.2 is needed. Probably multi column types with zone / zone offset are also needed. |
Created https://jadira.atlassian.net/browse/JDF-80 for tracking |
So, I've done all the preparatory work (renaming etc) that doesn't depend on JDBC 4.2, but then the problem - there is no JDBC 4.2 driver (other than maybe Derby) that could be used to test the setObject functionality to implement the remainder of this. I think it will be some time before those types that use setObject can be added. |
Thanks for the info. However, I'm not sure this will solve my issue since Java 8 doesn't include an equivalent to Joda's |
Yes, I think I misunderstood what you were suggesting - however I am glad I did the groundwork for 310 types.... Now I understand what you are asking, for each type you would want to map directly you would need to create a Java type descriptor (like JdbcDateTypeDescriptor) and a corresponding type (like DstSafeDateType). I wonder if there is an alternative way to do what you are trying to do. For the Single column types this is addressed by having them implement EnhancedUserType and provide an objectToSQLString() method. |
Did you manage to get the source building? I have prototyped out the approach and it looks like it should work - if you can build the source I will check in the changes for you to try out. Otherwise I can send you a jar to test. Actually it would help me if you can share any tests for the query on components that you are able for inclusion. Once we are happy with the approach, there is going to be a need to do some refactoring after - a large number of the other component types could benefit from this change and there will be an opportunity to further rationalise the code subsequently. |
I did manage to get it building (I ended up commenting out the modules required Java 5 or Java 8 installed). If you check in your changes, I should be able to try them out. |
I've just pushed a prototype change for the PersistentInterval |
Sorry about the delay in getting back to you. I was able to get the experimental changes to build. However, I realized that that the functionality I was looking for is already in the latest released version. I had accidentally grabbed the You may want to put a note somewhere on the Sourceforge page about what artifact ID to use for the appropriate artifacts. Sorry about the wild goose chase. Thanks for all of your help. |
The existing
PersistentInterval
type requires that you create Hibernate queries usingjava.util.Date
. It would be nice if we could query usingDataTime
instead.I was going to create a pull request for this but had issues getting
master
to build.The text was updated successfully, but these errors were encountered: