[Hibernate-JIRA] Created: (HHH-4467) hibernate should throw exception differentiating between null and transient
by Dean Hiller (JIRA)
hibernate should throw exception differentiating between null and transient
---------------------------------------------------------------------------
Key: HHH-4467
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4467
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Reporter: Dean Hiller
some teams report this as a usabiliy bug, others a feature...you can move to a feature if you like.
Hibernate should change the exception message
"not-null property references a null or transient value: net.voicelog.entities.scripts.CompareExpression.expression"
to be
1. not-null property is referencing a null value
AND
2. not-null property is referencing a transient value
Just do a quick if(property != null) throw 1 else throw 2
I have ran into many users being confused and users should not have to go check if the property is null, hibernate can do a quick check instead and throw 2 different exceptions to make our lives just a little bit easier. I personally have been tripped up by this a few times myself assuming it was transient or null on accident whereas if it just spit out the right exception to begin with, that would rock for such an easy change!
thanks,
Dean
--
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
15 years
[Hibernate-JIRA] Created: (HSHARDS-59) selectShardIdsFromShardResolutionStrategyData not finding identifiergenerator for subclasses
by Hans Aikema (JIRA)
selectShardIdsFromShardResolutionStrategyData not finding identifiergenerator for subclasses
--------------------------------------------------------------------------------------------
Key: HSHARDS-59
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSHARDS-59
Project: Hibernate Shards
Issue Type: Bug
Affects Versions: 3.0.0.Beta2
Environment: Hibernate 3.2.6-GA, Oracle 10.2.0.3
Reporter: Hans Aikema
Assignee: Max Ross
ShardedSessionImpl calls shardedSessionFactory.getIdentifierGenerator with the entity-name from the ShardResolutionData.
However getIdentifierGenerator is defined in the interface as:
public IdentifierGenerator getIdentifierGenerator(String rootEntityName);
ShardedSessionImpl should therefor first determine the rootEntityName for the entity at hand and use that entityname to determine the identifiergenerator:
[code]]
IdentifierGenerator idGenerator = shardedSessionFactory.getIdentifierGenerator(srsd.getEntityName());
[/code]
Should be changed to something like
[code]
EntityPersister entityPersister = shardedSessionFactory.getEntityPersister(srsd.getEntityName());
IdentifierGenerator idGenerator = shardedSessionFactory.getIdentifierGenerator(entityPersister.getRootEntityName());
[/code]
This error can be shown when using a superclass with a ShardEncodingIdentifierGenerator. For the subclasses the ShardResolutionStrategy will be consulted to determine the shardId of the object rather than having the ShardEncodingIdentifierGenerator extracting it from the id.
--
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
15 years