[Hibernate-JIRA] Closed: (HBX-612) Allow to specify a NamingStrategy to a console configuration
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-612?page=all ]
Max Rydahl Andersen closed HBX-612:
-----------------------------------
Resolution: Duplicate
> Allow to specify a NamingStrategy to a console configuration
> ------------------------------------------------------------
>
> Key: HBX-612
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-612
> Project: Hibernate Tools
> Type: Improvement
> Components: consoleconfiguration
> Versions: 3.1beta2
> Environment: Eclipse webtools 1.0
> Hibernate console plugin version: 3.1.0 beta2
> Hibernate 3.1
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
> Windows XP
> Reporter: Benjamin Francisoud
> Fix For: 3.2beta9
>
>
> See forum topic: set NamingStrategy for hbm2ddl
> http://forum.hibernate.org/viewtopic.php?t=947305&start=0&postdays=0&post...
> the 01 Mar 2006 entry
> ---
> When doing a schema export (or schema update) within the console perspective under hibernate eclipse plugin
> How can I set the NamingStrategy to ImprovedNamingStrategy ?
> I already do this in my application code, but when I use the plugin, I have errors or duplicated tables for example:
> - PHONENUMBER (created by the plugin)
> - PHONE_NUMBER (created by my code using ImprovedNamingStrategy)
> Adding an input field in the console configuration would be a good place in my opinion...
> My hibernate.cfg.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <hibernate-configuration>
> <session-factory name="sessionFactory">
> <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
> <property name="hibernate.cache.region_prefix">hibernate.app</property>
> <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
> <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
> <property name="hibernate.connection.url">jdbc:oracle:thin:@host:1591:BASE</property>
> <property name="hibernate.default_schema">LOGIN</property>
> <property name="hibernate.connection.username">LOGIN</property>
> <property name="hibernate.connection.password">PASSWORD</property>
> <property name="hibernate.connection.pool_size">1</property>
> <property name="show_sql">true</property>
> <property name="hibernate.hbm2ddl.auto">update</property>
>
> <!-- mapping files -->
> <mapping resource="package/Address.hbm.xml"/>
> <mapping resource="package/Person.hbm.xml"/>
> <mapping resource="package/PersonAddress.hbm.xml" />
> <mapping resource="package/PhoneNumber.hbm.xml" />
> </session-factory>
> </hibernate-configuration>
--
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, 6 months
[Hibernate-JIRA] Created: (HHH-2324) Column.getAlias(Dialect dialect) generates aliases longer than Dialect.getMaxAliasLenght()
by Matthias Koenig (JIRA)
Column.getAlias(Dialect dialect) generates aliases longer than Dialect.getMaxAliasLenght()
------------------------------------------------------------------------------------------
Key: HHH-2324
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2324
Project: Hibernate3
Type: Bug
Versions: 3.0.5, 3.2.0.ga
Reporter: Matthias Koenig
org.hibernate.mapping.Column.getAlias(Dialect dialect) doesn't honor Dialect.getMaxAliasLenght() all the time.
Given:
- a column named "ABCDEFGHIK_X"
- Dialect.getMaxAliasLenght() = 10
- uniqueInteger = 12
getAlias generates the alias "ABCDEFGHIK12_" which is over 10 characters (13 actually).
The problem happens, whenever an alias gets shortened due to an non-letter character and the shortened alias is less than or equal to Dialect.getMaxAliasLenght().
One possible fix could be another length check befor appending unique:
public String getAlias(Dialect dialect) {
String alias = name;
String unique = Integer.toString(uniqueInteger) + '_';
int lastLetter = StringHelper.lastIndexOfLetter(name);
if ( lastLetter == -1 ) {
alias = "column";
}
else if ( lastLetter < name.length()-1 ) {
alias = name.substring(0, lastLetter+1);
}
if ( alias.length() > dialect.getMaxAliasLength() ) {
alias = alias.substring( 0, dialect.getMaxAliasLength() - unique.length() );
}
boolean useRawName = name.equals(alias) &&
!quoted &&
!name.toLowerCase().equals("rowid");
if ( useRawName ) {
return alias;
}
else {
if ( alias.length() + unique.length() > dialect.getMaxAliasLength() ) {
alias = alias.substring( 0, dialect.getMaxAliasLength() - unique.length() );
}
return alias + unique;
}
}
--
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, 6 months
[Hibernate-JIRA] Created: (HHH-2323) Insert on an object with oneto many relationship becomes slow in some machines
by Krishnan Natesan (JIRA)
Insert on an object with oneto many relationship becomes slow in some machines
------------------------------------------------------------------------------
Key: HHH-2323
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2323
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.1
Environment: using jdk1.4.2 on windows mcahine xp professional., hibernate 3.1.1, SQL server 2005 using jdbc driver from mticrsoft
Reporter: Krishnan Natesan
My application picks up messages from a message queue and persists two objects with one to many relationship.
The objects are
Object A --------< Object B
There are about 4000 messages that need to be persisted.
The Object A would be instered from the first message and in all subsequent messages the same object would be used.
Each message has One Object A and 900 Object Bs.
In one machine the persistence is fast about 50 mins while in the other it takes about 5 hrs. While when I did the persistence with jdbc in both machines it was 50 mins
To me it looks like in the slower machine hibernate is not doing bacth inserts.
--
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, 6 months