[Hibernate-JIRA] Created: (HHH-3978) Expose Hibernate version via non-compile-time constant expression
by Steve Ebersole (JIRA)
Expose Hibernate version via non-compile-time constant expression
-----------------------------------------------------------------
Key: HHH-3978
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3978
Project: Hibernate Core
Issue Type: Improvement
Components: core
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Fix For: 3.2.x, 3.3.x, 3.5
Currently we expose the Hibernate version via a public static final field (org.hibernate.cfg.Envrionment#VERSION). It is defined using what JLS terms a compile-time constant expression. The issue with this approach is that compilers are free to inline the value of this field when it is encountered. For example, say a Hibernate user is attempting to do something like:
if ( Environment.VERSION.equals( "3.3.0.ga" ) {
// do something 3.3.0-specific...
}
The issue is that the compiler is free to inline the "Environment.VERSION" reference with its compile-time constant expression value. So if the user compiles this code against Hibernate 3.3.0.ga initially, it does not matter at all what version is present at runtime. The compiler will inline (re: replace) Environment.VERSION with "3.3.0.ga" and that if check will always resolve to true!
http://java.sun.com/docs/books/jls/third_edition/html/binaryComp.html#13.4.9
The same "feature" is not extended to methods. We should make the version accessible only from static method (and we should avoid making it final as it appears some compiler may even inline static final method calls).
--
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, 7 months
[Hibernate-JIRA] Created: (BVAL-143) desribe path with an object model
by Emmanuel Bernard (JIRA)
desribe path with an object model
---------------------------------
Key: BVAL-143
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-143
Project: Bean Validation
Issue Type: Improvement
Components: spec-general
Affects Versions: 1.0 proposed final draft
Reporter: Emmanuel Bernard
Priority: Minor
path are today strings with dot separating properties. But it break when Set or Iterable are used.
We could replace that with
--- First strawman, must evolve --
class PathElement {
String getName();
PathElement getParentPath();
boolean isIterable();
boolean isIndexed();
Object getIndex();
//TODO int getIndex()?
// not happy about that as it is only useful for Constraintciolation
PathElement getChild();
}
PathElement would be used for Constraintvuilation, maybe CVContext etc
can this be refactored using inheritance + generics to have an IndexedPathElement only when it matters (probably no unfortunately)
--
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, 7 months
[Hibernate-JIRA] Created: (HHH-3977) ALTER SESSION queries cause the hibernate second level cache to be cleared
by hard hat (JIRA)
ALTER SESSION queries cause the hibernate second level cache to be cleared
--------------------------------------------------------------------------
Key: HHH-3977
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3977
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1GA
Oracle 10g
Reporter: hard hat
Priority: Minor
When issuing an ALTER SESSION statement to oracle, this causes hibernate to think that the second level cache got dirty and the cache is cleared.
Example:
----------------------------------------------------------------------------------------------------------------------------
session.beginTransaction();
// set date format
SQLQuery sqlQuery = session.createSQLQuery("alter session set nls_date_format='DD/MM/YYYY");
sqlQuery.executeUpdate();
// query something
Query query = session.createQuery("from Person");
// -- at this point, all queried person objects are in the 2nd level cache,
// you can check this, if you stop here with the debugger and list the cache statistics
// close session
session.getTransaction().rollback();
// -- at this point, all Person elements are gone from the cache, which
// you can once again check by looking at the cache statistics
----------------------------------------------------------------------------------------------------------------------------
Without the ALTER SESSION statement, the 2nd level cache is populated with the loaded elements.
--
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, 7 months
[Hibernate-JIRA] Created: (HHH-3973) Problem retrieving column name using the AliasToBeanTransformer using jconnect - Sybase.
by Jose Carlos Canova (JIRA)
Problem retrieving column name using the AliasToBeanTransformer using jconnect - Sybase.
----------------------------------------------------------------------------------------
Key: HHH-3973
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3973
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: JCONNECT 6.0.5 with Sybase 12.0.5
Reporter: Jose Carlos Canova
Attachments: could not execute query.doc
Hibernate CustomLoader$Metadata class on method getColumnName method (line 571) its not performing correctly when using the a stored procedure calll... Driver had also a problem which i saw that was fixed. Current version of the jconnect version 6.0.5 return the ALIAS name (variable on a declare statement...) and the user can get the name of the alias on getLabelName.... instead of the getColumn name ..
my suggestion for the code is something like that ....
public String getColumnName(int position) throws HibernateException {
try {
Strign columnName = resultSetMetaData.getLabelName( position );
if (columnName == null or "".equals(columnName.trim())
columnName = resultSetMetaData.getColumnName( position );
return columnName;
}catch( SQLException e ) {
throw new HibernateException( "Could not resolve column name [" + position + "]", e );
}
}
A workaroud solution (its urgent) will be very wellcome... (that does not include mapping the bean on hibernate mapping ... this is not a good solution... ) a tip how to override the customloader class will be great...
--
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, 7 months
[Hibernate-JIRA] Created: (ANN-845) @CollectionOfElements not using @Where clause to manage collection
by Clay Atkins (JIRA)
@CollectionOfElements not using @Where clause to manage collection
------------------------------------------------------------------
Key: ANN-845
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-845
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.1.GA
Environment: Oracle10g
Reporter: Clay Atkins
Here is my sample:
{code}
@CollectionOfElements()
@JoinTable(name = "DEAL_MSR", joinColumns=@JoinColumn(name = "DEAL_ID"))
@Where(clause="DATA_TYPE_CD='B'")
@IndexColumn(name = "REL_PRD_NUM", nullable = false)
private List<BBB> periodBaseProjections;
@CollectionOfElements()
@JoinTable(name = "DEAL_MSR", joinColumns=@JoinColumn(name = "DEAL_ID"))
@Where(clause="DATA_TYPE_CD='I'")
@IndexColumn(name = "REL_PRD_NUM", nullable = false)
private List<III> periodIncrementalProjections;
{code}
The primary key for table DEAL_MSR is DEAL_ID, DATA_TYPE_CD and REL_PRD_NUM. Each @CollectionOfElements needs to map a subset of the rows related through the DEAL_ID. The @Where clause is not used when inserting or updating the table. Maybe this is the wrong syntax or the wrong approach or maybe something is broken.
I do want to use @CollectionOfElements so that the associated data is an embedded attribute with a lifecycle bound to the single entity if possible.
--
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, 7 months