-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue with filering fields of type Time and Timestamp #22
Comments
Have you tried without the ts prefix? |
With or without ts, I am not able to get the response in the second case (Time) It is not able to pick the query, giving the error as either "ts" or "10:00:00" is not a text type. Is there any other way to pass the Time type filter? |
I took a quick look at the code and I think there is currently no support for Time fields, only dates, datetimes and timestamps. Can you share your JPA entity class (or at least a subset with the time field)? |
@TeMPOraL( TemporalType.TIME ) This is the way I am using the field in my entity class. I also feel that type Time is not handled in the code. NOTE : There is one more issue I am facing that is regarding getting the count of the records using the utils method. In this case the util method is giving me the count of entries rather than the count of records. While record.class is being passed as the method parameter. I was expecting the method to return the count of records. Although if the search filter is applied on the main class fields it works fine. |
Code checks the class in the model directly, ignoring any JPA annotations such as If you need an immediate workaround you can have a separate query parameter and pass it as a custom filter into JPAUtils.
Not sure I quite grasped what you were saying here. Can you give me an example of the JPAUtils call in each case? |
queryEntitiesCount(EntityManager em, Class entity, QueryParameters q) 2: When I am searching using fields of a nested class. Eg: filter=entries.userId:EQ:user1 where a list of entry is the field of Class. In laymen's term if I say, A record have multiple entries, and if the search criteria is applied on the field of entry class, In the result it is returning the count of entries instead of the records. Although it should always be the count of records. |
I have added filtering support for LocalTime and OffsetTime fields. Use these types instead of Date with @TeMPOraL annotation. I have also fixed the queryEntitiesCount method, which was applying DISTINCT in a wrong way. |
Can you please merge the code and release the latest version so that I will be able to use and test the scenario. Thanks |
Hi, we will include this in the next regular release in a few weeks. |
I used the below mentioned snapshot version: com.kumuluz.ee.rest But it is giving me the below error: "The POM for com.kumuluz.ee.rest:kumuluzee-rest:jar:1.6.0-SNAPSHOT is missing, no dependency information available" Is it the right way to use? If not, please let me know how to use it. Thanks |
@raaj31sharma please check again. Version 1.6.0-SNAPSHOT should now be available. |
@osbeorn It is still not working, getting error as not able to download jar from proximity. Pls let me know if its to be used in a different way. As of now I am using in the same way as mentioned above. |
I am using the following dependency to use the snapshot version: Please let me know if there is a different way to use this. Also, exactly when are you planning to release the next version of the library. |
I have Entity class A which has this timestamp type field say "startTime". I want to filter records on the basis of "startTime".
I tried this way :
filter=startTime:GTE:ts'2021-12-10T10:00:00:000Z' - Here startTime corresponds to Timestamp field in MY SQL
filter=startTime:GTE:ts'10:00:00' - Here startTime corresponds to Time field in MY SQL
Although I am not getting any error as such but looks like this filter is getting ignored while fetching the data.
Kindly help me to understand how to pass the time and timestamp fields in the request query
The text was updated successfully, but these errors were encountered: