[Hibernate-JIRA] Created: (EJB-370) @GeneratedValue and id populated with function (MSSQL 2000)
by Thierry Accart (JIRA)
@GeneratedValue and id populated with function (MSSQL 2000)
-----------------------------------------------------------
Key: EJB-370
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-370
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.2.1
Environment: MSSQL 2000 server, ms sql 2000 jdbc driver, Hibernate EntityManager 3.2.1.GA, JBOSS 4.2.2 GA
Reporter: Thierry Accart
When a table has its primary key (int id_ populated in SQL with IDENTITY, everything is fine.
Now, if you create a sql function getNextID() that returns the next Id for this table, remove the identity setup for this column, and set getNextId() as default value,
the entity manager seems to not catch the new value of ID.
in extenso : I created a new Entity
its ID is 0 in java.
I persisted it
-> when sql column was setup to Identity, the entitymanager retrieved the new id from SQL
-> when sql column was setup to be not null and have default value, the row was inserted in SQL (with the ID given by function call), but the entitymanager did not retrieve the new ID from SQL, keeping 0 as id value.
Is it a normal behaviour, or should entityManager retrieve the new Id in any case ?
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (HHH-3369) Let the proxy extends the most possible lower class in a class heirarchy
by Amr Noaman (JIRA)
Let the proxy extends the most possible lower class in a class heirarchy
------------------------------------------------------------------------
Key: HHH-3369
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3369
Project: Hibernate3
Issue Type: New Feature
Components: core
Affects Versions: 3.3.0.CR1
Reporter: Amr Noaman
This feature may resolve the famous ClassCastException that appear with all those who worked with proxies and type heirarchies.
If you have a type hierarchy like this:
A
/ \
B C
The following statement will return a proxy that extends A:
session.Load(typeof(A), Id);
The load operation blindly creates a proxy that extends A, even if the real object is of type B or C, and this makes casting to B or C not possible.
Instead, It may check the discriminator value, and accordingly, it may let the proxy extend the proper actual type. So, if the discriminator says that this record is of type B, the proxy should extend type B instead of A, and so on.
--
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
16 years, 5 months