[Hibernate-JIRA] Created: (HHH-2438) Ability to transform dates/timezones from/to timezones
by Uzay Takaoglu (JIRA)
Ability to transform dates/timezones from/to timezones
------------------------------------------------------
Key: HHH-2438
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2438
Project: Hibernate3
Type: New Feature
Components: core
Environment: all
Reporter: Uzay Takaoglu
when date or timestamp are retrieved from the database, almost all the applications utilizing hibernate require some type of formatting especially applications serving users accross multiple timezones require time/date change to these timezones. Currently applications do custom coding to handle this circumstece. Hibernate can provide such functionality simplifying usability.
Such parameters can be set at the hib session level for dates/timestamps. API caller would set databases timezone info, e.g. GMT and set timezone desired while extracting the data e.g. EST. When the data is loaded, conversion automatically happens. It could be applicable to both read and write.
--
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
17 years, 10 months
[Hibernate-JIRA] Created: (HHH-2437) SessionFactoryImpl.getClassMetadata method is not supported CGLib enhanced classes
by Alexey Kakunin (JIRA)
SessionFactoryImpl.getClassMetadata method is not supported CGLib enhanced classes
----------------------------------------------------------------------------------
Key: HHH-2437
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2437
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1, 3.2.2
Reporter: Alexey Kakunin
In some cases Hibernate may returns classes, enhanced by CGLib. But if then we will try to get Class MetaData for such classes - it will be failed. For example:
Object obj = getObjectFrom Hibernate(); //here CGLib enhanced object is returned
ClassMetaData metaData = sessionFactory.getClassMetaData(obj.getClass());
//even we just get class from hibernate and it's class supported by Hibernate - we will get here NULL.
Simple Solution is to check before getting name from class:
public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException {
Class fixedClass = persistentClass;
if (net.sf.cglib.proxy.Enhancer.isEnhanced(persistentClass)) {
// try to get class itself
fixedClass = valueClass.getSuperclass();
}
return getClassMetadata( fixedClass.getName() );
}
but not sure it is really correct fix
--
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
17 years, 10 months
[Hibernate-JIRA] Commented: (HHH-1) Optimize Hibernate for the bulk insertion of related entities
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comm... ]
Steve Ebersole commented on HHH-1:
----------------------------------
This limitation regarding <join/>s is not even within the realm of control for this solution. And actually the same limitation would hold as well in the case of <joined-subclass/>.
The reason is that it is actually the persister which performs the atomic inserts, not the actions.
Example:
class Super { ... }
class Sub extends Super { ... }
For each entity creation here we have exactly one entity insert action even though we will have 2 inserts commands executed (again, same thing for <join/>). Again, this is controlled by the persister, not the action.
To properly account for those scenarios, we would need to tweak the algorithm such that it could group together Sub entity insertions within a given relational dependency chain and then have the atomic inserts performed together for any given level of dependency. There are a couple of way to achieve that aspect. I'll give some thought as to the most proficient way to to it.
> Optimize Hibernate for the bulk insertion of related entities
> -------------------------------------------------------------
>
> Key: HHH-1
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1
> Project: Hibernate3
> Type: New Feature
> Components: core
> Environment: Hibernate 1.2, MySql 3.1
> Reporter: Bradley Leupen
> Priority: Minor
> Attachments: bulk_insert.patch
>
>
> It is currently difficult to batch the creation of persistent entities that maintain associations with other entities.
> Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network.
--
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
17 years, 10 months
[Hibernate-JIRA] Commented: (ANN-140) Discriminator column not supported with JOINED strategy
by Amit Kasher (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-140?page=co... ]
Amit Kasher commented on ANN-140:
---------------------------------
I'd like to add another possible requirement for discriminator column support. If you have a discriminator column, you can have it inside DB constraints, and achieve constraints in which subclasses participate as different entities.
Example: I have the following entities:
A {
id, name
}
B extends A {
height
}
C extends A {
width
}
I need the following constraint: I don't want to allow (more than 1:) 2 or more instances of B with the same name, and I don't want (more than 1:) 2 or more instances of C with the same name. However, I DO want to allow 1 instance of B with the name "Jack", and another instance, this time of C, with that same name, "Jack". The only way to achieve this, I think, is having a discriminator column in A which will allow you to define a unique constraint containing A.discriminator and A.name.
> Discriminator column not supported with JOINED strategy
> -------------------------------------------------------
>
> Key: ANN-140
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-140
> Project: Hibernate Annotations
> Type: Bug
> Versions: 3.1beta6
> Environment: Hibernate 3.1rc2, Hibernate Annotations 3.1b6
> Reporter: Steven Grimm
>
>
> Section 9.1.27 of the EJB3 persistence public draft says, "The DiscriminatorColumn annotation is used to define the discriminator column for SINGLE_TABLE and JOINED mapping strategies." But Hibernate ignores the DiscriminatorColumn annotation when the mapping strategy is JOINED; when a JOINED entity is persisted, its discriminator column is not included in the SQL "insert" statement, resulting in a not-null constraint violation if the discriminator column is marked NOT NULL in the database.
> The JOINED strategy with discriminators is pretty ubiquitous in EJB3 sample code and tutorials out on the net, so lots of people are likely to run into this as they try out EJB3 for the first time. A few examples:
> http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos-ejb3/howtoejb...
> http://www.solarmetric.com/Software/Documentation/4.0.0EA/docs/full/html/...
> http://www.caucho.com/resin-3.0/amber/tutorial/cmp-inherit/index.xtp
--
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
17 years, 10 months
[Hibernate-JIRA] Created: (HHH-2352) ClassCastException in Session.get()
by Alexey Romanchuk (JIRA)
ClassCastException in Session.get()
-----------------------------------
Key: HHH-2352
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2352
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1
Environment: Hibernate 3.2.1
Reporter: Alexey Romanchuk
Priority: Critical
We have inheritance with joined-subclass mapping. Imagine that we have parent class - BaseObject and two subclasses - Client and Item. We enable second level cache on BaseObject.
try to load Client in first session
Client client = ( Client ) s1.get( Client.class, 1851727l );
after this we have this client in second level cache.
Next - load another subclass with same id:
Item item = ( Item ) s2.get( Item.class, 1851727l );
and here we have ClassCastException because hibernate found BaseObject (Client) and return it instead of null.
The solution is class check in org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache() function. This is crititcal bug that violates Session API.
--
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
17 years, 10 months