[Hibernate-JIRA] Created: (HHH-5140) quoted column doesn't be quoted in sub-query
by Strong Liu (JIRA)
quoted column doesn't be quoted in sub-query
--------------------------------------------
Key: HHH-5140
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5140
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.1
Reporter: Strong Liu
Fix For: 3.5.x
for example:
{quote}
<union-subclass name="Employee" table="UEmployee">
<property name="title" column="`unique`"/>
<property name="department" column="dept"/>
<many-to-one name="manager" column="mgr_id" class="Employee" cascade="none"/>
<set name="minions" inverse="true" lazy="true" cascade="all">
<key column="mgr_id"/>
<one-to-many class="Employee"/>
<filter name="region" condition="region = :userRegion"/>
</set>
</union-subclass>
{quote}
note, that "title" property's column name is unique, and "unique" is a keyword in all DBs,
hibernate generates the column quoted, like this:
{quote}
create table UEmployee (
person_id bigint not null,
name varchar(255),
company varchar(255),
region varchar(255),
"unique" varchar(255),
dept varchar(255),
mgr_id bigint,
primary key (person_id),
unique (name)
)
{quote}
but with a simple hql query "from Person", which "Person" is the parent class of Employee, it will issue the following sql query:
{quote}
select
person0_.person_id as person1_0_,
person0_.name as name0_,
person0_.company as company0_,
person0_.region as region0_,
person0_."unique" as unique1_1_,
person0_.dept as dept1_,
person0_.mgr_id as mgr3_1_,
person0_.contactOwner as contactO1_2_,
person0_.clazz_ as clazz_
from
( select
person_id,
name,
company,
region,
null as unique,
null as dept,
null as mgr_id,
null as contactOwner,
0 as clazz_
from
UPerson
union
select
person_id,
name,
company,
region,
unique,
dept,
mgr_id,
null as contactOwner,
1 as clazz_
from
UEmployee
union
select
person_id,
name,
company,
region,
null as unique,
null as dept,
null as mgr_id,
contactOwner,
2 as clazz_
from
UCustomer
) person0_
where
person0_.region = ?
{quote}
see this "null as unique"?
this can be reproduced by org.hibernate.test.subclassfilter.UnionSubclassFilterTest
--
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, 5 months
[Hibernate-JIRA] Created: (HBX-1144) Weird Column Length problem - new length value in annotation being ignored
by Duncan Kinnear (JIRA)
Weird Column Length problem - new length value in annotation being ignored
--------------------------------------------------------------------------
Key: HBX-1144
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1144
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.0.GA
Environment: Tar file was hibernate-3.2.6.ga.tar. Glassfish version 2.0 ur2. PostgreSQL version 8.x (various)
Reporter: Duncan Kinnear
We are using Hibernate as our persistence layer with NetBeans 6.7.1, EJB3, Glassfish and PostgreSQL.
We have almost 200 tables defined as EJB entities. We use annotations on the entities to define the tables/columns. As we are still in an early testing phase, we regularly drop all the tables in the database and use the Hibernate auto schema update to recreate them.
Recently we changed the length of a standard field that appears in many of our tables. The column is called ID_ORDER and is defined in the entities using the following code:
@Column(name = "ID_ORDER", length = STANDARD_ID_ORDER_LENGTH, nullable = false)
private String idOrder;
where STANDARD_ID_ORDER_LENGTH is defined as a public static final int in the superclass of these tables.
This length used to be 20, but we increased this to 50, recompiled all the affected classes, dropped all the tables and redeployed.
Now, on 2 developer machines this change worked correctly, with the new tables having their ID_ORDER columns all length 50.
However, on the other 2 developer machines, one table (called FEED_TYPE) gets recreated with the ID_ORDER column with length 20. This also occurs when we deploy the resulting EAR file to another server running Glassfish.
We have tried all sorts of things on these machines to try and 'fix' this. We have removed the column completely, recreated the table and it is still there! We have explicitly set the length in the annotation of the column of this one table and the length is always ignored. We have renamed the existing column and deployed, but the new column is always length 20. We have renamed the table and then recreated it - still wrong. We have even dropped the entire database and recreated it, but the length of 20 remains!
We are pulling our hair out on this one, it just doesn't make any sense. Where is hibernate 'caching' the length definition of this one column in one table?
--
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, 5 months
[Hibernate-JIRA] Created: (HHH-5061) tar.gz of 3.5.0-Final contains files which are marked setuid and executable
by Darryl Miles (JIRA)
tar.gz of 3.5.0-Final contains files which are marked setuid and executable
---------------------------------------------------------------------------
Key: HHH-5061
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5061
Project: Hibernate Core
Issue Type: Bug
Components: build
Affects Versions: 3.5.0-Final
Reporter: Darryl Miles
Priority: Minor
The tar.gz version of the distribution contains files with the, "setuid", "setgid" and "stick bit" set. These are denoted by the "s", "s" and "t" characters in the unix file permissions bits.
Further more once those bits are reset it can be seen the executable bits "x" are also set.
Further more they are world writable, where as other files in the JAR are mode 0644 (-rw-r--r--).
$ tar -ztvf hibernate-distribution-3.5.0-Final-dist.tar.gz | head -n 20
-rwsrwsrwt 0/0 26428 2007-06-29 20:24 hibernate-distribution-3.5.0-Final/lgpl.txt
-rwsrwsrwt 0/0 1456 2007-06-29 20:24 hibernate-distribution-3.5.0-Final/hibernate_logo.gif
-rwsrwsrwt 0/0 195261 2010-03-31 18:38 hibernate-distribution-3.5.0-Final/changelog.txt
-rwsrwsrwt 0/0 3893179 2010-03-31 19:52 hibernate-distribution-3.5.0-Final/hibernate3.jar
-rwsrwsrwt 0/0 37609 2010-03-31 19:16 hibernate-distribution-3.5.0-Final/hibernate-testing.jar
...SNIP...
$ chmod ug-s,o-t changelog.txt hibernate3.jar hibernate_logo.gif hibernate-testing.jar lgpl.txt
$ ls -l
total 4088
-rwxrwxrwx. 1 root root 195261 2010-03-31 18:38 changelog.txt
drwxr-xr-x. 3 root root 4096 2010-04-01 08:46 documentation
-rwxrwxrwx. 1 root root 3893179 2010-03-31 19:52 hibernate3.jar
-rwxrwxrwx. 1 root root 1456 2007-06-29 20:24 hibernate_logo.gif
-rwxrwxrwx. 1 root root 37609 2010-03-31 19:16 hibernate-testing.jar
-rwxrwxrwx. 1 root root 26428 2007-06-29 20:24 lgpl.txt
drwxr-xr-x. 6 root root 4096 2010-04-01 08:46 lib
drwxr-xr-x. 24 root root 4096 2010-03-31 19:13 project
$ find . -maxdepth 1 -type f -perm +0111 -exec chmod a-x {} \;
$ ls -l
total 4088
-rwxrw-rw-. 1 root root 195261 2010-03-31 18:38 changelog.txt
drwxr-xr-x. 3 root root 4096 2010-04-01 08:46 documentation
-rw-rwxrw-. 1 root root 3893179 2010-03-31 19:52 hibernate3.jar
-rw-rw-rwx. 1 root root 1456 2007-06-29 20:24 hibernate_logo.gif
-rwxrwxrwx. 1 root root 37609 2010-03-31 19:16 hibernate-testing.jar
-rwxrwxrwx. 1 root root 26428 2007-06-29 20:24 lgpl.txt
drwxr-xr-x. 6 root root 4096 2010-04-01 08:46 lib
drwxr-xr-x. 24 root root 4096 2010-03-31 19:13 project
$ chmod go-w changelog.txt hibernate3.jar hibernate_logo.gif hibernate-testing.jar lgpl.txt
$ ls -l
total 4088
-rw-r--r--. 1 root root 195261 2010-03-31 18:38 changelog.txt
drwxr-xr-x. 3 root root 4096 2010-04-01 08:46 documentation
-rw-r--r--. 1 root root 3893179 2010-03-31 19:52 hibernate3.jar
-rw-r--r--. 1 root root 1456 2007-06-29 20:24 hibernate_logo.gif
-rw-r--r--. 1 root root 37609 2010-03-31 19:16 hibernate-testing.jar
-rw-r--r--. 1 root root 26428 2007-06-29 20:24 lgpl.txt
drwxr-xr-x. 6 root root 4096 2010-04-01 08:46 lib
drwxr-xr-x. 24 root root 4096 2010-03-31 19:13 project
The last output above is how those file permissions should look.
Some people might consider any files marked setuid/setgid and executable and owned by "root" and world writable to be a security concern, especially if the archive was extracted as root (for shared use on a system).
--
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, 5 months
[Hibernate-JIRA] Created: (HHH-5068) Fix for AttributeFactory class to manage ParameterizedType
by Romain Rossi (JIRA)
Fix for AttributeFactory class to manage ParameterizedType
----------------------------------------------------------
Key: HHH-5068
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5068
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.5.0-Final
Reporter: Romain Rossi
To make org.hibernate.ejb.metamodel.AttributeFactory.PluralAttributeMetadataImpl.getClassFromGenericArgument(Type) works after migrating from 3.3.2.GA to 3.5.0-Final. I have to change the method whith:
private Class<?> getClassFromGenericArgument(java.lang.reflect.Type type) {
Class<?> javaType;
Object unsafeElementType = type;
if ( unsafeElementType instanceof Class ) {
javaType = (Class) unsafeElementType;
}
else if ( unsafeElementType instanceof TypeVariable ) {
final java.lang.reflect.Type upperBound = ( ( TypeVariable ) unsafeElementType ).getBounds()[0];
javaType = getClassFromGenericArgument( upperBound );
}
// ADDED TO FIX THE ParameterizedType
else if ( unsafeElementType instanceof ParameterizedType) {
javaType = (Class<?>)((ParameterizedType)type).getRawType();
}
// END FIX
else {
throw new AssertionFailure("Fail to process type argument in a generic declaration. Type: "
+ type.getClass() );
}
return javaType;
}
Is there an other way to manage the ParameterizedType?
--
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, 5 months