Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

TimeBetweenQueryMacroHandler does not support LocalTime and OffsetTime #68

Closed
Flaurite opened this issue May 20, 2021 · 1 comment
Closed
Assignees
Milestone

Comments

@Flaurite
Copy link
Contributor

Description

This problem occurs while using DATE_INTERVAL operation and JPQL condition in the Filter.

Steps to reproduce

case 1:

  1. Create in the filter JPQL condition with "No parameter" type
  2. Write macro with LocalTime property, e.g. @between({E}.myLocalTimeProperty, now, now + 1, minute).
  3. Apply this condition

AR

java.lang.IllegalArgumentException: Unsupported date type class java.time.LocalTime
	at io.jmix.core.DateTimeTransformations.newUnsupportedTypeException(DateTimeTransformations.java:158)
	at io.jmix.core.DateTimeTransformations.transformFromZdtInternal(DateTimeTransformations.java:99)
	at io.jmix.core.DateTimeTransformations.transformFromZDT(DateTimeTransformations.java:84)
	at io.jmix.data.impl.querymacro.TimeBetweenQueryMacroHandler.getParams(TimeBetweenQueryMacroHandler.java:143)
	at io.jmix.eclipselink.impl.JmixEclipseLinkQuery.addMacroParams(JmixEclipseLinkQuery.java:730)
	at io.jmix.eclipselink.impl.JmixEclipseLinkQuery.getQuery(JmixEclipseLinkQuery.java:495)
	at io.jmix.eclipselink.impl.JmixEclipseLinkQuery.getResultList(JmixEclipseLinkQuery.java:130)
	at io.jmix.eclipselink.impl.JpaDataStore.executeQuery(JpaDataStore.java:495)
	at io.jmix.eclipselink.impl.JpaDataStore.loadAll(JpaDataStore.java:166)
	at io.jmix.core.datastore.AbstractDataStore.loadList(AbstractDataStore.java:127)
	at io.jmix.core.impl.DataManagerImpl.loadList(DataManagerImpl.java:102)
	at io.jmix.ui.model.impl.CollectionLoaderImpl._load(CollectionLoaderImpl.java:92)
	at io.jmix.ui.model.impl.CollectionLoaderImpl.load(CollectionLoaderImpl.java:75)
	at io.jmix.ui.component.impl.AbstractSingleFilterComponent.apply(AbstractSingleFilterComponent.java:308)
	at io.jmix.ui.component.impl.AbstractSingleFilterComponent.onValueChanged(AbstractSingleFilterComponent.java:301)
	at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)
	at io.jmix.ui.component.impl.AbstractComponent.publish(AbstractComponent.java:85)
	at io.jmix.ui.component.impl.AbstractValueComponent.componentValueChanged(AbstractValueComponent.java:154)
	at io.jmix.ui.component.impl.AbstractField.lambda$attachValueChangeListener$ab1c93c8$1(AbstractField.java:145)

case 2:

  1. In the Filter add condition for the LocalTime property
  2. Select "in interval" operation
  3. Select, e.g.: LAST - 2 - minutes
  4. Close dialog.

AR
The same stacktrace.

@andreysubbotin
Copy link
Contributor

andreysubbotin commented May 21, 2021

It always works with Date properties. The same in CUBA. Please disable functionality in UI.

@andreysubbotin andreysubbotin removed the type: bug Something isn't working label May 21, 2021
@andreysubbotin andreysubbotin removed this from the 1.0.0 milestone May 21, 2021
@knstvk knstvk changed the title TimeBetweenQueryMacroHandler does not support LocalTime and OffestTime TimeBetweenQueryMacroHandler does not support LocalTime and OffsetTime May 25, 2021
@andreysubbotin andreysubbotin added this to the 1.1.0 milestone Jun 11, 2021
@lovtsovaik lovtsovaik self-assigned this Jul 30, 2021
@lovtsovaik lovtsovaik assigned owlet1997 and unassigned lovtsovaik Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants