[Hibernate-JIRA] Created: (HBX-1071) OracleMetaDataDialect not 8i compliant ... join keyword versus (+)
by Nobody Who Cares (JIRA)
OracleMetaDataDialect not 8i compliant ... join keyword versus (+)
------------------------------------------------------------------
Key: HBX-1071
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1071
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Affects Versions: 3.2.0.GA
Environment: Whatever 3.2.X version is packaged w/ JBoss Seam 2.0.2.SP1, Oracle 8.1.7.4.0
Reporter: Nobody Who Cares
Priority: Minor
The SQL constants used in the prepared statements use the "left join" phrase instead of the 8i equivalent syntax where the "(+)" symbol is located appropriately based on right/left qualifier. Subsequent execution produces the following exception as expected with unrecognized syntax:
Caused by: java.sql.SQLException: ORA-00933: SQL command not properly ended
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
643)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
a:1819)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:2015)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
edStatement.java:395)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
dStatement.java:339)
at org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect.getTableResult
Set(OracleMetaDataDialect.java:672)
at org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect.getTables(Orac
leMetaDataDialect.java:221)
... 30 more
The 8i syntax should be used since it is compatible with all versions of Oracle. I realize that 8i is a decade+ old...but it is still employed in many commercial and government mission critical enterprise systems.
Overriding the class with the generic JDBCMetaDataDialect class (i.e. hibernatetool.metadatadialect property value) also produces an exception (i.e. Invalid column name) because the ResultSet inner class convertRow() method implementation uses getString"<table name>") as opposed to the more precise getString(<index>) technique.
--
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, 9 months
[Hibernate-JIRA] Created: (HBX-1073) Patch to make working ReverseEngineeringStrategy.isForeignKeyCollectionLazy
by Oleg Panashchenko (JIRA)
Patch to make working ReverseEngineeringStrategy.isForeignKeyCollectionLazy
---------------------------------------------------------------------------
Key: HBX-1073
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1073
Project: Hibernate Tools
Issue Type: Patch
Components: reverse-engineer
Affects Versions: 3.2.1, 3.2.2, 3.2LATER
Environment: HibernateTools-3.2.2.Beta1, Mysql-5.0
Reporter: Oleg Panashchenko
Attachments: patch-reveng-isForeignKeyCollectionLazy.diff
Function ReverseEngineeringStrategy.isForeignKeyCollectionLazy from custom reverse engineering strategy, according to JavaDoc, should control whether generated collection is lazy or not. However, boolean value, which the function returns, is ignored by reverse engineering tool, and collection is always generated lazy, which is default.
Changes.
- If the function isForeignKeyCollectionLazy returns false, the patch adds lazy="false" to appropriate collection entry into proper .hbm.xml file.
- The patch adds another function, ReverseEngineeringStrategy.isForeignKeyReferenceLazy with the same signature as the original one. The new function controls laziness of the reverse side of the collection.
The patch does not change default behavior of the reverse engineering tool, when the above strategy functions are not present in a custom strategy Java 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
17 years, 9 months
[Hibernate-JIRA] Created: (HBX-1069) Hibernate Configuration View crashes Eclipse
by Georg Sendt (JIRA)
Hibernate Configuration View crashes Eclipse
--------------------------------------------
Key: HBX-1069
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1069
Project: Hibernate Tools
Issue Type: Bug
Environment: Version: 3.4.0
Build id: I20080617-2000
Windows XP
jdk1.5.0_15
hibernate tools 3.2.2.GA
Reporter: Georg Sendt
After opening the Hibernate Configuration View the workbench crashes.
Information from the ErrorLog-View:
1. A workspace crash was detected. The previous session did not exit normally. Not using saved taglib indexes. An exception stack trace is not available.
---
---
2. java.lang.NoClassDefFoundError: org/eclipse/ui/internal/util/SWTResourceUtil
at org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider.getImage(AnyAdaptableLabelProvider.java:166)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getImage(WrappedViewerLabelProvider.java:117)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:165)
at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:145)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:932)
at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:102)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1012)
at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:466)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2041)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:827)
at org.eclipse.jface.viewers.AbstractTreeViewer.createAddedElements(AbstractTreeViewer.java:340)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalAdd(AbstractTreeViewer.java:270)
at org.eclipse.jface.viewers.TreeViewer.internalAdd(TreeViewer.java:652)
at org.hibernate.eclipse.console.viewers.xpl.MTreeViewer.add(MTreeViewer.java:106)
at org.eclipse.ui.progress.DeferredTreeContentManager$3.runInUIThread(DeferredTreeContentManager.java:353)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
--
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, 9 months
[Hibernate-JIRA] Commented: (HBX-524) Reverse of one-to-one relationships
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-524?page=co... ]
Max Rydahl Andersen commented on HBX-524:
-----------------------------------------
Marcio - you mentioned to me you already solved this, could you elaborate here ?
> Reverse of one-to-one relationships
> -----------------------------------
>
> Key: HBX-524
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-524
> Project: Hibernate Tools
> Issue Type: Bug
> Components: reverse-engineer
> Affects Versions: 3.1beta2
> Environment: HIbernate 3.1, Oracle 9i
> Reporter: Andrea Cattani
>
> Hi,
> I've posted this issue to the forum and got this response from Max, Hibernate Team:
> "the reveng tools does not detect this as a one-to-one. it probably could, so add a request/patch to jira."
> The problem I've faced is the following:
> I have two tables, let's say
> - table A with column ID (PK) and other fields
> - table B with column ID (PK) and other fields
> table B has a foreign key constraint against table A, from column ID to column ID (one-to-one)
> When I reverese the tables with the HibernateTools I have such a resultant mapping for table B:
> <class name="B" table="B" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned" />
> </id>
> <[b]many-to-one name[/b]="a" class="A" update="false" insert="false" fetch="select">
> <column name="ID" length="12" not-null="true" unique="true" />
> </many-to-one>
> ....
> And this one for table A:
> <class name="A" table="A" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned"/>
> </id>
> <set name="b" inverse="true">
> <key>
> <column name="ID" length="12" not-null="true" unique="true" />
> </key>
> <[b]one-to-many[/b] class="B" />
> </set>
> </class>
> while I was expecting something like:
> [i]<one-to-one name="a" class="A" constrained="true"/>[/i]
> in table B, and the same (or nothing) in table A
> Thank you
> Andi
--
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, 9 months
[Hibernate-JIRA] Created: (HHH-3381) org.lds.stack.validator.NotEmptyTrimed is mispelled
by Mike Heath (JIRA)
org.lds.stack.validator.NotEmptyTrimed is mispelled
---------------------------------------------------
Key: HHH-3381
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3381
Project: Hibernate3
Issue Type: Improvement
Reporter: Mike Heath
Attachments: configuration.patch, hibernatepersistence.patch
In our applications, we would like to make the "yes_no" Hibernate type the default for all booleans. We currently use @Type("yes_no") everywhere. This is annoying.
We could use org.hibernate.cfg.Mappings.typeDefs to set a default. Mappings.typeDefs gets populated from org.hibernate.cfg.Configuration.typeDefs. However, Configuration.typeDefs only gets referenced by Configuration.reset(), Configuration.createMappings(), and AnnotationConfiguration.createExtendedMappings(). Configuration.typeDefs could be very useful but currently it's a waste of an object reference.
Adding the following method (or something similar) to Configuration would give us a good first step to making they typeDefs field usable and would open the door to allowing us to make "yes_no" the default for all boolean fields:
public void addTypeDef(String className, TypeDef typeDef) {
typeDefs.put(className, typeDef)
}
Even if we had Configuration.addTypeDef, there would be now way to add a TypeDef to the configuration before the EntityManagerFactory gets created. org.hibernate.ejb.HibernatePersistence creates an Ejb3Configuration object (which holds a Configuration instance) and immediately creates the EntityManagerFactory. If the call to "new Ejb3Configuration()" were placed in a protected method, we could override that method and there obtain the Configuration instance and invoke addTypeDef().
We currently have our own PersistenceProvider that is based on HibernatePersistence. After we create the Ejb3Configuration instance, we use reflection to get to Configure.typeDefs to add "yes_no" TypeDefs for "boolean" and "java.lang.Boolean" and it works very well... except for the fact that it's an egregious hack.
I've attached a patch for core, and a patch for entitymanager.
--
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, 9 months
[Hibernate-JIRA] Created: (HHH-3382) net.sf.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass:
by cristian vargas (JIRA)
net.sf.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass:
-------------------------------------------------------------------------------------------
Key: HHH-3382
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3382
Project: Hibernate3
Issue Type: Bug
Environment: hibernate 2.1.7 , mysql
Reporter: cristian vargas
Attachments: diagram.JPG
i got this error in my project , please can anybody help me? i have an inheritance mapping , you can see the class diagrama in the attachment. i want to map the sell class, there are two references , one to the client class and the other one to the employment class.
this is the mapping that i built
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="Inventory.Sell" table="Sell">
<id name="Id_Sell" type="integer">
<column name="Id_Sell" />
<generator class="identity" />
</id>
<property name="FechaPedido" type="date">
<column name="FechaPedido" />
</property>
<many-to-one name="Id_Cliente" class="Inventory.Client" >
<column name="Id_Cliente" not-null="false" />
</many-to-one>
<many-to-one name="Id_Employment" class="Inventory.Employment" >
<column name="Id_Employment" not-null="false" />
</many-to-one>
</class>
</hibernate-mapping>
and this is the mapping for the inheritance
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="Inventory.Person" table="person" >
<id name="Id_Persona" type="integer">
<column name="Id_Persona" />
<generator class="identity" />
</id>
<property name="CI" type="string">
<column name="CI" length="20" />
</property>
<property name="nombre" type="string">
<column name="Nombre" length="100" />
</property>
<property name="trabajoDir" type="string">
<column name="DireccionTrabajo" length="100" />
</property>
<property name="DireccionDomicilio" type="string">
<column name="DireccionDomicilio" length="100" />
</property>
<property name="Celular" type="string">
<column name="Celular" length="100" />
</property>
<set name="emailAddresses" table="email">
<key column="Id_Email"/>
<element type="string" column="Email"/>
</set>
<set name="telefono" table="telefono">
<key column="Id_Telefono"/>
<element type="string" column="Telefono"/>
</set>
<set name="fax" table="fax">
<key column="Id_Fax"/>
<element type="string" column="Fax"/>
</set>
<joined-subclass name="Inventory.Employment" table="employment">
<key column="Id_Empleado"/>
<property name="Sueldo" type="string">
<column name="Sueldo" length="100" />
</property>
<property name="Moneda" type="string">
<column name="Moneda" length="100" />
</property>
<property name="FechaContrato" type="date">
<column name="FechaContrato" />
</property>
</joined-subclass>
<joined-subclass name="Inventory.Client" table="client">
<key column="Id_Cliente"/>
</joined-subclass>
</class>
</hibernate-mapping>
this is the error that i get:
net.sf.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass: ......................................
at net.sf.hibernate.loader.Loader.instanceAlreadyLoaded(Loader.java:531) at net.sf.hibernate.loader.Loader.getRow(Loader.java:498) at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:213) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:990) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:965) at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:93) at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:288) at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3303) at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:336) at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3156) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138) at net.sf.hibernate.loader.Loader.doList(Loader.java:1033) at net.sf.hibernate.loader.Loader.list(Loader.java:1024) at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1553) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1530) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1522) at hibernate.conexion.consulta(conexion.java:177) at _Control__Acceso._jspService(_Control__Acceso.java:80) [/Control_Acceso.jsp] at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)
--
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, 9 months