[Hibernate-JIRA] Closed: (HHH-963) Dates comarison in query fails
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-963?page=co... ]
Steve Ebersole closed HHH-963.
------------------------------
Closing stale resolved issues
> Dates comarison in query fails
> ------------------------------
>
> Key: HHH-963
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-963
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.0.5
> …
[View More]Environment: Hibernate 3.0x, HSQL
> Reporter: Pavel Kaplin
> Assignee: Steve Ebersole
> Priority: Critical
>
> Expression like "date1 = date2" are being calculated incorrectly. When compared dates are equal, expression "date1 = date2" is false, but "date1 > date2" is true. It's not seems right.
> Try to use the following code in your Eg application:
> Session session = factory.openSession();
> Date date = new Date();
> AuctionItem auctionItem = new AuctionItem();
> auctionItem.setEnds(date);
> session.save(auctionItem);
> session.close();
> session = factory.openSession();
> Query query = session.createQuery("SELECT item FROM org.hibernate.auction.AuctionItem AS item WHERE item.ends = :date");
> query.setDate("date", date);
> List list = query.list();
> System.out.println("Date = " + date.getTime());
> System.out.println("AuctionItem.date = " + ((AuctionItem) list.iterator().next()).getEnds().getTime());
> System.out.println("List size == " + list.size());
> if (list.size() != 1) throw new RuntimeException ("AAAAAAAAAAAAAA!");
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[View Less]
13 years, 11 months
[Hibernate-JIRA] Closed: (HHH-1173) Hibernate does not properly deal with empty strings in maps on Oracle
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1173?page=c... ]
Steve Ebersole closed HHH-1173.
-------------------------------
Closing stale resolved issues
> Hibernate does not properly deal with empty strings in maps on Oracle
> ---------------------------------------------------------------------
>
> Key: HHH-1173
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1173
> Project: Hibernate …
[View More]Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 rc2
> Reporter: Keith D Gregory
> Attachments: null-value-bug.tar.gz
>
>
> This is really a duplicate of HHH-772, but has an actual use case, rather than an abstract "maps should contain nulls"
> 1) Define an object that contains a map property
> 2) Create an instance of that object, insert a map entry that contains an empty string as its value, persist
> 3) Retrieve the object - note that the map now contains the mapping key -> null
> 4) Use putAll() to copy the map entries from the first object to a new object, persist the new object
> 5) Retrieve both, note that the second map does not contain the same entries as the first
> Incidentally, the java.util.Map API has the following to say about null values:
> "Some map implementations have restrictions on the keys and values they may contain. For example, some implementations prohibit null keys and values, and some have restrictions on the types of their keys. Attempting to insert an ineligible key or value throws an unchecked exception, typically NullPointerException or ClassCastException."
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[View Less]
13 years, 11 months
[Hibernate-JIRA] Closed: (HHH-890) Multi join SQL querry are not correctly produced
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-890?page=co... ]
Steve Ebersole closed HHH-890.
------------------------------
Closing stale resolved issues
> Multi join SQL querry are not correctly produced
> ------------------------------------------------
>
> Key: HHH-890
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-890
> Project: Hibernate Core
> Issue Type: Bug
> …
[View More] Components: core
> Reporter: Misko Hevery
>
> I would like to produce a query such as this....
> SELECT c.ID as componentID
> FROM GEN_COMPONENT as c
> INNER JOIN GEN_COMPONENT_VALUE v0 ON c.ID=v0.component_id
> INNER JOIN GEN_COMPONENT_VALUE v1 ON c.ID=v1.component_id
> WHERE componentKind_id IN (?,?)
> AND v0.property_id=? AND v0.val=?
> AND v1.property_id=? AND v1.val=?
> I would expect that this code would produce the above SQL.
> (pseudo-code)
> Criteria comp = session.createCriteria(Component.class, "c");
> Criteria v1 = comp.createCriteria(Component.PROP_VALUES, "v1");
> Criteria v2 = comp.createCriteria(Component.PROP_VALUES, "v2");
> v1.add(Restrictions.eq("property_id", p1);
> v1.add(Restrictions.eq("val", 60);
> v2.add(Restrictions.eq("property_id", p2);
> v2.add(Restrictions.eq("val", 50));
> I have tried many different combinations but i either get a runtime exception or this incorect SQL
> SELECT c.ID as componentID
> FROM GEN_COMPONENT as c
> INNER JOIN GEN_COMPONENT_VALUE v ON c.ID=v.component_id
> WHERE componentKind_id IN (?,?)
> AND v.property_id=? AND v.val=?
> AND v.property_id=? AND v.val=?
> In either case it is not what I want. As far as I can tell this is not possible... But I might be wrong...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[View Less]
13 years, 11 months