[Hibernate-JIRA] Created: (HHH-2428) PostgreSQL 8 serial sequence name for long table names (and columns) does not use standard format
by Andrew Wheeler (JIRA)
PostgreSQL 8 serial sequence name for long table names (and columns) does not use standard format
-------------------------------------------------------------------------------------------------
Key: HHH-2428
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2428
Project: Hibernate3
Type: Bug
Versions: 3.2.0.ga
Environment: PostgresSQL 8.1, Windows
Reporter: Andrew Wheeler
Priority: Minor
Tables with serial columns where the both the table and the column are long do not conform to the standard sequence format of [table]_[column]_seq
CREATE TABLE incident_property_relationship
(
incident_property_relationship_id int4 NOT NULL DEFAULT nextval('incident_property_relationshi_incident_property_relationshi_seq'::regclass),
.
.
}
This table was created using the statement:
create table incident_property_relationship {
incident_property_relationship_id serial not null,
.
.
}
I have fixed the issue by creating a new dialect for postgreSQL (PostgreSQL8Dialect) and changed the function getIdentitySelectString to:
public String getIdentitySelectString(String table, String column, int type) {
return new StringBuffer().append("select currval(pg_get_serial_sequence('")
.append(table)
.append("','")
.append(column)
.append("'))")
.toString();
}
This should also work where the serial column has a custom sequence generator.
--
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, 11 months
[Hibernate-JIRA] Commented: (HHH-1853) CREATE SCHEMA inside database-object need to execute before tables are created
by tom quas (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1853?page=c... ]
tom quas commented on HHH-1853:
-------------------------------
Living on the edge... Seriously, that seems to be the quick(!)/only(?) way for us to make our tests run. Since we're maintaining our production schema manually we don't have a problem here.
Besides, since we drop the tables, what's so funny about dropping the schemas, too?
> CREATE SCHEMA inside database-object need to execute before tables are created
> ------------------------------------------------------------------------------
>
> Key: HHH-1853
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1853
> Project: Hibernate3
> Type: Improvement
> Versions: 3.1.3
> Environment: hsqldb 1.8.0
> Reporter: Mattias Jiderhamn
> Priority: Minor
> Attachments: create-schema.patch
>
>
> In order to have Hibernate create database schemas for hsqldb, you have to insert a <database-object> in your mapping file (http://forums.hibernate.org/viewtopic.php?p=2305138). Problem is, all the database-object statements are executed after the tables are created, so tables in non-default schemas will not be created. To get around this, you have to first use Configuration.generateSchemaCreationScript() to get the schemas, and then Configuration.generateSchemaUpdateScript() to get the tables inside the schemas.
> (This is a bit problematic when using Springs LocalSessionFactoryBean)
--
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, 11 months
[Hibernate-JIRA] Commented: (HHH-1853) CREATE SCHEMA inside database-object need to execute before tables are created
by tom quas (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1853?page=c... ]
tom quas commented on HHH-1853:
-------------------------------
I prepared a patch against the 3.2 branch that solves this problem for our environment, namely H2, PostgreSQL, and SQL Server 2005. Note that I could not make it work with Hypersonic/HSQL since its CREATE SCHEMA statement requires a mandatory AUTHORIZATION part that I didn't want to deal with at this point. Somebody else might know how to fix this problem in an efficient way. Anyway, H2 gave our test suite a tremendous boost, so dropping HSQL was the logical step and we're happy.
See attachment create-schema.patch
> CREATE SCHEMA inside database-object need to execute before tables are created
> ------------------------------------------------------------------------------
>
> Key: HHH-1853
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1853
> Project: Hibernate3
> Type: Improvement
> Versions: 3.1.3
> Environment: hsqldb 1.8.0
> Reporter: Mattias Jiderhamn
> Priority: Minor
>
>
> In order to have Hibernate create database schemas for hsqldb, you have to insert a <database-object> in your mapping file (http://forums.hibernate.org/viewtopic.php?p=2305138). Problem is, all the database-object statements are executed after the tables are created, so tables in non-default schemas will not be created. To get around this, you have to first use Configuration.generateSchemaCreationScript() to get the schemas, and then Configuration.generateSchemaUpdateScript() to get the tables inside the schemas.
> (This is a bit problematic when using Springs LocalSessionFactoryBean)
--
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, 11 months
[Hibernate-JIRA] Created: (ANN-436) @IndexColumn does not work with discriminator-inheritance on the target entity of the list
by ron piterman (JIRA)
@IndexColumn does not work with discriminator-inheritance on the target entity of the list
------------------------------------------------------------------------------------------
Key: ANN-436
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-436
Project: Hibernate Annotations
Type: Bug
Versions: 3.2.0.cr1
Reporter: ron piterman
When using inheritance on the target entity of a List, @IndexColumn annotation does not work. Hibernate does not populate the index column value on the target entites. As a result, the sort_order column is null.
@Entity
public class PropertyOwner {
@OneToMany
@IndexColumn(name="sort_order", mappedBy="owner",cascade=CascadeType.ALL)
private List<AbstractProperty> properties;
...
}
@Entity
@DiscriminatorColumn(name="property_type",discriminatorType=DiscriminatorType.STRING)
public abstract class AbstractProperty {
@ManyToOne
private PropertyOwner owner;
}
@Entity
@DiscriminatorValue("integer")
public class IntegerProperty extends AbstractProperty {
int integerValue;
...
}
@Entity
@DiscriminatorValue("string")
public class IntegerProperty extends AbstractProperty {
String stringValue
...
}
--
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, 11 months