[Hibernate-JIRA] Created: (HHH-5056) Criteria API with ProjectionList and Unique result
by Ahmed Ali Elsayed Ali Soliman (JIRA)
Criteria API with ProjectionList and Unique result
--------------------------------------------------
Key: HHH-5056
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5056
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.3.2, Oracel 11g
Reporter: Ahmed Ali Elsayed Ali Soliman
Priority: Critical
when you make a select statement with Criteria API & use ProjectionList to retrieve some columns then use the unique result
make at least 2 projection list (2 columns or more)
ProjectionList projectionList = Projections.projectionList() .add(Projections.property("ColumnA")) .add(Projections.property("ColumnB"));
criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
the result must be retrieved in 2 dimensional array of Object(Object[][])
but the result are one dimensional array with one column only.
Note:- when you remove the unique result it works fine but when you add it, it make this behavior.
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-5772) hibernate.test.unionsubclass2 has "create index" problem with Teradata
by David Repshas (JIRA)
hibernate.test.unionsubclass2 has "create index" problem with Teradata
----------------------------------------------------------------------
Key: HHH-5772
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5772
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.3
Environment: Hibernate 3.5.3 on Windows against a Teradata 13.0 Database
Reporter: David Repshas
Attachments: IndexDiffs.zip
Here's the details from the log file:
=======================================
14:54:34,535 DEBUG SchemaExport:377 -
create index UCustomerAddressIndex on UCustomer (address, zip)
14:54:34,551 ERROR SchemaExport:348 - Unsuccessful: create index UCustomerAddressIndex on UCustomer (address, zip)
14:54:34,551 ERROR SchemaExport:349 - [Teradata Database] [TeraJDBC 13.00.00.12] [Error 3706] [SQLState 42000] Syntax error: Must specify index field(s) for CREATE INDEX.
14:54:34,551 DEBUG SchemaExport:377 -
================
The problem is that Teradata requires
the names of one or more columns whose values are to be indexed.
So:
create index index1 () on T_USER
will fail while:
create index index1 (user_name) on T_USER
will succeed
This can be fixed as follows:
1) Add the following method to Dialect.java
public boolean doesCreateIndexRequireColumnNames() {
return false;
}
2) Add the same method to TeradataDialect.java, but have it
return "true".
3) Add new code to org.hibernate.mapping.index in
buildSqlCreateIndexString() to add the column names
(code differences against Hibernate 3.5.3 are in attched diff file)
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-5774) casting exceptions with Teradata database
by David Repshas (JIRA)
casting exceptions with Teradata database
-----------------------------------------
Key: HHH-5774
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5774
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.3
Environment: Hibernate 3.5.3 on Windows XP against a Teradata 13.0 Database
Reporter: David Repshas
Attachments: castingDiffs.txt
Several test cases encounter a java.lang.ClassCastException because Teradata maps 'Double Precision' columns to 'Float':
This code from line 223 of test.component.basic.ComponentTest:testCustomColumnReadAndWrite illustrates the problem:
{code:borderStyle=solid}
Double heightViaSql = (Double)s.createSQLQuery("select height_centimeters from t_user where
t_user.username='steve'").uniqueResult();
{code}
height_centimeters was declared as "DOUBLE PRECISION not null"
and so the attempt to cast a Float to a Double causes the ClassCast Exception
Variants of this code appear in the files that follow:
.\project\testsuite\src\test\java\org\hibernate\test\component\basic\ComponentTest.java
.\project\testsuite\src\test\java\org\hibernate\test\compositeelement\CompositeElementTest.java
.\project\testsuite\src\test\java\org\hibernate\test\hql\ASTParserLoadingTest.java
.\project\testsuite\src\test\java\org\hibernate\test\instrument\cases\TestCustomColumnReadAndWrite.java
.\project\testsuite\src\test\java\org\hibernate\test\join\JoinTest.java
.\project\testsuite\src\test\java\org\hibernate\test\subselect\SubselectTest.java
.\project\testsuite\src\test\java\org\hibernate\test\unionsubclass2\UnionSubclassTest.java
.\project\testsuite\src\test\java\org\hibernate\test\joinedsubclass\JoinedSubclassTest.java
This can be fixed by changing the code to use new Double(String x)
The problem entry above then becomes:
{code:borderStyle=solid}
Double heightViaSql = new Double(s.createSQLQuery("select height_centimeters from t_user
where t_user.username='steve'").uniqueResult().toString());
{code}
The attached file castingDiffs contains the changes made against Hibernate 3.5.3
--
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, 10 months
[Hibernate-JIRA] Created: (ANN-472) @UniqueConstraint declaration is not friendly towards inheritance or reflection
by Ted Bergeron (JIRA)
@UniqueConstraint declaration is not friendly towards inheritance or reflection
-------------------------------------------------------------------------------
Key: ANN-472
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-472
Project: Hibernate Annotations
Type: Improvement
Versions: 3.2.0.ga
Environment: Hibernate 3.2 GA
Reporter: Ted Bergeron
The current way to define a composite unique constraint is limiting.
@Table(name="tbl_sky",
uniqueConstraints = {@UniqueConstraint(columnNames={"month", "day"})}
)
Suppose I have an abstract base class called A that gives me Id and Name, subclassed by abstract class B that gives me Customer. Then I have many concrete classes that subclass B. For all of these, I'd want the combination of Name and Customer to be unique. As I do not use @Table with abstract base classes, I currently have to repeat: uniqueConstraints = {@UniqueConstraint(columnNames={"name", "customer_id"})} on all concrete classes.
If we had an alternate way to define these constraints at the property level (as XDoclet did with hibernate 2), I could define this in the base classes and inherit the constraint declaration.
The other need is that I would like to use reflection to scan the properties and apply proper validations in the view layer. With @Column(unique = true) this is easy to do. The view layer makes an AJAX call and all is well. For a composite constraint, it does not work well currently.
--
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, 10 months