[Hibernate-JIRA] Created: (HHH-4057) Error occurs when the not-null column has a default value in the DB but the field in object has no default value.
by Rupesh Kumar (JIRA)
Error occurs when the not-null column has a default value in the DB but the field in object has no default value.
-----------------------------------------------------------------------------------------------------------------
Key: HHH-4057
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4057
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: Hibernate 3.3.2
Reporter: Rupesh Kumar
I have a column in the database which is not null and has a default value.
In the Java object, I don't have any default value set on the field mapped to this column. When this object is saved, Hibernate throws up an error because it tried to insert a null value in the not-null column. Since DB can generate the value for this column, hibernate should use that.
I can not use generated attribute in hibernate mapping file because this column value is not always generated. It is generated only when no value is specified for this column while inserting.
Hibernate should inspect the database and find out which columns has default value set on it. If there is anything set on it, insert should ignore the mapped field if the value is not defined for it.
--
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
14 years, 11 months
[Hibernate-JIRA] Created: (HHH-4954) Support Criteria API restriction index-refering functions for many-to-many, indexed collections
by Marius (JIRA)
Support Criteria API restriction index-refering functions for many-to-many, indexed collections
-----------------------------------------------------------------------------------------------
Key: HHH-4954
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4954
Project: Hibernate Core
Issue Type: Improvement
Components: query-criteria
Affects Versions: 3.5.0-CR-2
Reporter: Marius
The problem is that the restrictions from Criteria API can't use hql functions.
I have a many-to-many relation but I want to left join the other side only with the first index (0).
In HQL(starting from 3.5.0-CR-2 for many-to-many relation) to get the first user's address I can write:
left join user.addresses address with index(address) = '0'
The generated SQL will look like this:
select * from USER user
left outer join
USER_ADDRESS address1_
on user_.ADDRESS_ID=address1_.USER_ID
and (
address1_.IDX='0'
)
left outer join
ADDRESS address2_
on address1_.ADDRESS_ID=address2_.ADDRESS_ID
where USER_ADDRESS is the table used for many-to-many relation and IDX is the index column
So I want to be able to write in Criteria like this:
.createAlias("user.addresses", "address", Criteria.LEFT_JOIN, Restrictions.eq("index(address)", 0))
Or maybe Restrictions.indexEq("address", 0).
Index-refering functions to implement: INDEX(), MININDEX(), MAXINDEX()
--
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
14 years, 11 months
[Hibernate-JIRA] Created: (HHH-3817) JBC second level cache integration can cache collection data
by Brian Stansberry (JIRA)
JBC second level cache integration can cache collection data
------------------------------------------------------------
Key: HHH-3817
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3817
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Reporter: Brian Stansberry
Assignee: Brian Stansberry
Fix For: 3.3.x
Scenario with two transactions dealing with a single collection:
tx1 reads collection, cache miss
tx1 goes to database to read collection
tx2 reads collection, cache miss
tx2 goes to database to read collection
tx2 does JBC putForExternalRead to store empty collection
tx2 updates collection
tx2 removes collection from JBC (since any collection update triggers a org.hibernate.cache.Cache.evict which is implemented as a JBC removeNode)
tx1 does JBC putForExternalRead to store empty collection -- STALE DATA
With entities, if the db is using REPEATABLE_READ this won't be a problem, as the DB won't allow the tx2 update until tx1 commits. With a collection there is nothing to lock on. It would be a problem for entities with READ_COMMITTED as well.
--
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
14 years, 11 months