[Hibernate-JIRA] Created: (HBX-1100) hbm2dll creates FK constraint names that are too large for taget database dialect
by Duncan Keysell (JIRA)
hbm2dll creates FK constraint names that are too large for taget database dialect
---------------------------------------------------------------------------------
Key: HBX-1100
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1100
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.4 Beta1
Reporter: Duncan Keysell
When hbm2dll creates FK constraint names, it does so without following database resrictions. As hbm2dll knows it is using the Oracle10gDialect then it should not attempt to create FK constraint names that have more than 30 characters. With union-subclass mapping the pattern used by hbm2dll is to give a FK constraint an 18 character name on the class that directly has the association requiring the FK. If that class is subclassed the FK constraint added to the tables of the subclasses has 18+8n characters. Where n is the level of subclassing. Only two levels of subclassing are required before the constraint name exceeds 30 characters as below.
I know it is possible to configure the initial name used for constraints using the foreign-key attribute in the mapping. However if I set that to 1 character then I still have a problem when 1 + 4*8 = 33. Therefore even using the foreign-key attribute I can only get 3 levels of subclassing.
Shouldn't the algorithm to create FK names be aware of the 30 character limit, i.e be dialect aware. Couldn't it simply create a hashcode of the hashcode it currently creates and limit it to 30 characters (including the 'FK').
In the example below constraints of the lengths shown get added to each table for the many-to-one mapping with name="requestedNE":
Class
IACEndpointConfigElement (FK4C10C05A145A4B50) 18 chars
IInterfaceConfigElement (FK4C10C05A145A4B50b6728c4a) 18 + 8 = 26 chars
IFRvcConfigElement (FK4C10C05A145A4B50b6728c4ace4cc838) 18 + 8 + 8 = 34 chars ERROR
Hibernate version:
3.2.2
Mapping documents:
<class name="productSpecific.advancedAppInterfaces.attachmentCircuitService.IACEndpointConfigElement" table="IACEndpointConfigElement" abstract="true">
<many-to-one name="requestedNE"
class="productSpecific.advancedAppInterfaces.attachmentCircuitService.IACServiceNEAssignmentConfigElement"
column="requestedNE_ID"
foreign-key="none"
not-found="ignore"
/>
<union-subclass name="productSpecific.advancedAppInterfaces.attachmentCircuitService.IInterfaceConfigElement" table="IInterfaceConfigElement" abstract="false">
<union-subclass name="productSpecific.advancedAppInterfaces.attachmentCircuitService.IFRvcConfigElement" table="IFRvcConfigElement" abstract="false">
</union-subclass>
</union-subclass>
</class
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):
[hibernatetool] 2008-11-26 09:56:40,000 DEBUG SchemaExport:303 -
[hibernatetool] create table developer.IFRvcConfigElement (
[hibernatetool] INSTANCEID number(19,0) not null,
[hibernatetool] oid varchar2(2048 char) not null,
[hibernatetool] ReferenceKey varchar2(2048 char),
[hibernatetool] InstanceName varchar2(255 char),
[hibernatetool] InstanceDescription varchar2(255 char),
[hibernatetool] requestedNE_ID number(19,0),
[hibernatetool] ProtocolIFType number(10,0),
[hibernatetool] InterfaceEncapType number(10,0),
[hibernatetool] Dlci number(10,0),
[hibernatetool] primary key (INSTANCEID)
[hibernatetool] );
[hibernatetool] alter table developer.IFRvcConfigElement
[hibernatetool] add constraint FK4C10C05A145A4B50b6728c4ace4cc838
[hibernatetool] foreign key (requestedNE_ID)
[hibernatetool] references developer.IACSrvcNEAssgnmntCnfgElmnt;
[hibernatetool] 2008-11-26 10:00:18,515 ERROR SchemaExport:274 - Unsuccessful: alter table developer.IFRvcConfigElement add constraint FK4C10C05A145A4B50b6728c4ace4cc838 foreign key (requestedNE_ID) references developer.IACSrvcNEAssgnmntCnfgElmnt
[hibernatetool] 2008-11-26 10:00:18,515 ERROR SchemaExport:275 - ORA-00972: identifier is too long
Debug level Hibernate log excerpt:
DEBUG
Problems with Session and transaction handling?
N/A
--
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
11 years, 9 months
[Hibernate-JIRA] Created: (HHH-7002) SchemaExport ERROR when using in-memory database (H2) - drop constraint issue HHH000389
by andrea handevidt (JIRA)
SchemaExport ERROR when using in-memory database (H2) - drop constraint issue HHH000389
---------------------------------------------------------------------------------------
Key: HHH-7002
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-7002
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.0.1
Environment: H2Dialect, Hibernate 4.0
Reporter: andrea handevidt
Priority: Minor
Attachments: HibernateError.zip
HHH-000389 resolved an issue with property name="hibernate.hbm2ddl.auto" value="create". It now performs a drop prior to create. When using an in-memory database this will throw errors on table with foreign key constraints.
ERROR (SchemaExport:426) - HHH000389: Unsuccessful: alter table security_key drop constraint FK3031A4E0BE21E8D7
ERROR (SchemaExport:427) - Table "SECURITY_KEY" not found; SQL statement:alter table security_key drop constraint FK3031A4E0BE21E8D7
I noticed that the sqlDropString for org.hibernate.mapping.Table appends "if exists". This is missing for org.hibernate.mapping.ForeignKey.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[Hibernate-JIRA] Created: (HV-548) Validation annotation override in class inheritance
by Alex Landini (JIRA)
Validation annotation override in class inheritance
---------------------------------------------------
Key: HV-548
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-548
Project: Hibernate Validator
Issue Type: New Feature
Components: annotation-processor
Affects Versions: 4.2.0.Final
Reporter: Alex Landini
Hibernate validator should provide something like JPA @AttributeOverride to override parent class constraints.
public class A {
@Size(min = 1, max = 10)
private String field1;
@Min(2)
private Integer field2;
...
}
@ConstraintOverrides({
@ConstraintOverride(name="field1", constraint={@Size(min=4, max =20)}),
@ConstraintOverride(name="startDate", constraint={@Min(1)})
})
public class B extends A {
...
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[Hibernate-JIRA] Created: (ANN-469) bulk update with native sql queries
by Amir Pashazadeh (JIRA)
bulk update with native sql queries
-----------------------------------
Key: ANN-469
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-469
Project: Hibernate Annotations
Type: Improvement
Components: binder
Versions: 3.2.0.ga
Reporter: Amir Pashazadeh
Priority: Critical
Hibernate Annotations 3.2 does not support bulk update/deletes using native queries,
if I have something like:
@NamedNativeQuery(name = "testQuery", query = "delete from tb_test where id = ?")
in one of my entities, there will be following exception during build of SessionFactory :
Exception in thread "main" org.hibernate.cfg.NotYetImplementedException: Pure native scalar queries are not yet supported
at org.hibernate.cfg.annotations.QueryBinder.bindNativeQuery(QueryBinder.java:118)
at org.hibernate.cfg.annotations.QueryBinder.bindNativeQueries(QueryBinder.java:197)
at org.hibernate.cfg.AnnotationBinder.bindQueries(AnnotationBinder.java:281)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:404)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
------
I made a mistake and I reported this issue as HHH-2147 as an issue about Hibernate core! :(
--
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
11 years, 9 months
[Hibernate-JIRA] Created: (OGM-151) Reduce memory consumption by sharing the metadata information of Key objects
by Emmanuel Bernard (JIRA)
Reduce memory consumption by sharing the metadata information of Key objects
----------------------------------------------------------------------------
Key: OGM-151
URL: https://hibernate.onjira.com/browse/OGM-151
Project: Hibernate OGM
Issue Type: Improvement
Components: core
Reporter: Emmanuel Bernard
Today EntityKey, AssociationKey, RowKey are composed of a metadata part (table name and column names) and a data part (column values).
Besides, AssociationKey also embeds collection role and owner's EntityKey.
We could have a model where Key object receive a KeyMetadata object whose instances is shared and kept in Persister/Loader. This will reduce memory consumption.
We can in addition consider putting non identifier metadata in a separate object (collection role and entity key owner information) and pass this object to the GridDialect. This object could even be specialized per datastore based on specific metadata hosted on entity / associations.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[Hibernate-JIRA] Created: (OGM-150) memory consumption of AssociationKey
by Sanne Grinovero (JIRA)
memory consumption of AssociationKey
------------------------------------
Key: OGM-150
URL: https://hibernate.onjira.com/browse/OGM-150
Project: Hibernate OGM
Issue Type: Improvement
Reporter: Sanne Grinovero
Each AssociationKey is containing several fields which are related to the specific Role of the collection, and could be wrapped in a single object reusable for the specific role.
We could avoid exposing this object from the AssociationKey interface, so that the specific Dialect can define custom metadata.
Goals:
- reuse the object instances
- make sure that AssociationKey instances, which are potentially as many as the association instances in some configurations (not using custom serialization), have the minimum number of fields defined.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months