This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271802 - CriteriaQuery API bug using lessThan/greaterThan methods
Summary: CriteriaQuery API bug using lessThan/greaterThan methods
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.2
Hardware: PC Windows 10
: P2 normal (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-14 11:28 UTC by FiruzzZ
Modified: 2017-11-14 11:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (127.21 KB, text/plain)
2017-11-14 11:29 UTC, FiruzzZ
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FiruzzZ 2017-11-14 11:28:55 UTC
Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Windows 10 version 10.0 running on amd64
Java; VM; Vendor = 1.8.0_152
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.152-b16

Reproducibility: Happens every time

STEPS:
Build a criteriabuilder query and try to use CriteriaQuery methods: lessThan/OrEqualTo, greaterThan/OrEqual
query.where(cb.lessThanOrEqualTo(root.get(ProductoPrecioVenta_.desde), fecha));

ACTUAL:
IDE claims a syntax error: no suitable method found for lessThanOrEqualTo(Path<Date>,Date)

EXPECTED:
...

WORKAROUND: 
declare a variable and use it as parameter
Path<Date> path = root.get(ProductoPrecioVenta_.desde);
query.where(cb.lessThanOrEqualTo(path, fecha));
Comment 1 FiruzzZ 2017-11-14 11:29:02 UTC
Created attachment 165442 [details]
IDE log