[Hibernate-JIRA] Closed: (HBX-700) Custom type mapping is not possible when reverse-engineering Oracle TIMESTAMP(3) types
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-700?page=all ]
Max Rydahl Andersen closed HBX-700:
-----------------------------------
Resolution: Duplicate
should be solved by the issue that want to provide a db-type/native-type in type-mapping
> Custom type mapping is not possible when reverse-engineering Oracle TIMESTAMP(3) types
> --------------------------------------------------------------------------------------
>
> Key: HBX-700
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-700
> Project: Hibernate Tools
> Type: Bug
> Components: reverse-engineer
> Environment: 3.2 svn, Oracle 10g, Oracle JDBC Driver version - "10.2.0.1.0"
> Reporter: Genandiy Donchyts
> Attachments: Test.hbm.xml, hbm2java.cfg.xml, schema.sql
>
> Original Estimate: 1 hour
> Remaining: 1 hour
>
> When reverse-engineering Oracle database containint column with TIMESTAMP(3) type it is not recognized as a TIMESTAMP and "serializable" type is used instead of timestamp. This happens because of the bug in Oracle JDBC driver since it returns OTHER (1111) instead of TIMESTAMP(93).
> When type-mapping is provided in the form:
> <type-mapping>
> <sql-type jdbc-type="TIMESTAMP(3)" hibernate-type="timestamp" />
> </type-mapping>
> ... it is not used because hibernate can't find TIMESTAMP(3) JDBC data type.
> JDBCReader.java, processBasicColumns(Table table, ProgressListener progress):
> ...
> //TODO: column.setSqlType(sqlTypeName); //this does not work 'cos the precision/scale/length are not retured in TYPE_NAME
> //column.setSqlType(sqlTypeName);
> ...
> it would be nice to have this sqlTypeName set to Column and used during comparison with <type-mapping>, then mapping from "TIMESTAMP(3)" to "timestamp" would work. Currently only 1111 ("OTHER") is passed to Column and as result column does not know anything about "TIMESTAMP(3)"
> -----
> To reproduce an issue try to create simple Oracle database with one table:
> create table test(id TIMESTAMP(3));
> and run reverse-engineering task over it.
> ------
> HACK: custom handling of TIMESTAMP(*) types:
> Modify JDBCReader.java:
> private void processBasicColumns(Table table, ProgressListener progress) { // get the columns
> ...
> String sqlTypeName = (String) columnRs.get("TYPE_NAME");
> String columnName = (String) columnRs.get("COLUMN_NAME");
> // HACK: custom handling of TIMESTAMP(*)
> if(sqlTypeName.startsWith("TIMESTAMP")) {
> sqlType = java.sql.Types.TIMESTAMP;
> }
> ...
> See also forum post: http://forum.hibernate.org/viewtopic.php?t=961625&start=0&postdays=0&post...
--
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
18 years, 3 months
[Hibernate-JIRA] Closed: (HBX-687) problem creating SessionFactory
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-687?page=all ]
Max Rydahl Andersen closed HBX-687:
-----------------------------------
Fix Version: 3.2beta7
Resolution: Cannot Reproduce
need more details to reproduce.
> problem creating SessionFactory
> -------------------------------
>
> Key: HBX-687
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-687
> Project: Hibernate Tools
> Type: Bug
> Components: reverse-engineer, eclipse, consoleconfiguration
> Versions: 3.1.beta5
> Environment: Eclipse 3.1.2
> Hibernate 3.1.3
> Oracle 10g
> Reporter: torrance
> Fix For: 3.2beta7
>
>
> I created a configuration file and console configuration succefully .
> I also generated Java code succefully from existing Oracle DB through JDBC.
> But when I tried to create a SessionFactory in Hibernate Console. I got following error:
> Mapping documents:
> Code between sessionFactory.openSession() and session.close():
> java.lang.NullPointerException
> at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationFile(ClassLoaderHelper.java:91)
> at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationURL(ClassLoaderHelper.java:83)
> at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationsURLForResources(ClassLoaderHelper.java:117)
> at org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseConsoleConfigurationPreferences.java:81)
> at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:109)
> at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98)
> at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:37)
> at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:46)
> at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
> at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
> at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
--
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
18 years, 3 months
[Hibernate-JIRA] Commented: (HBX-680) Enable Caching/Saving database meta data
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-680?page=co... ]
Max Rydahl Andersen commented on HBX-680:
-----------------------------------------
should be possible by generating a reveng.xml file that contains the schema....or write a MetadataDialect that can do the caching ....alternatively provide a specifalized MetadataDialect that can read metadata from TeraData faster (should be possible, right ?)
> Enable Caching/Saving database meta data
> ----------------------------------------
>
> Key: HBX-680
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-680
> Project: Hibernate Tools
> Type: Improvement
> Components: reverse-engineer
> Versions: 3.1.beta5
> Environment: Windows XP JDK 1.4, Teradata 7
> Reporter: Todd Nine
>
>
> I'm currently connecting to Tera Data and reverse engineering using the Hibernate IDE. While I have specified both the schema-selection element as well as table-filter element, my performance is still very slow (> 15 minutes with every table addition). Is it possible to give the user the option to enable caching of the database metadata? In the case of reverse engineering existing tables, the schema will never change or change very little, and querying the database for them vs. a local cache is very inefficient.
--
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
18 years, 3 months
[Hibernate-JIRA] Closed: (HBX-664) Patch to allow reverse engineering to work with tables and associations ending with "s"
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-664?page=all ]
Max Rydahl Andersen closed HBX-664:
-----------------------------------
Resolution: Duplicate
there is a issue reporting the error elsewhere.
thank you for the patch, but it does not solve the problem completly since
it still assumes what the actual "other side" is instead of locating it and use its proper name.
> Patch to allow reverse engineering to work with tables and associations ending with "s"
> ----------------------------------------------------------------------------------------
>
> Key: HBX-664
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-664
> Project: Hibernate Tools
> Type: Patch
> Components: reverse-engineer
> Versions: 3.1.beta5
> Reporter: Jarkko Lietolahti
>
>
> Index: java/org/hibernate/tool/hbm2x/pojo/BasicPOJOClass.java
> ===================================================================
> --- java/org/hibernate/tool/hbm2x/pojo/BasicPOJOClass.java (revision 9925)
> +++ java/org/hibernate/tool/hbm2x/pojo/BasicPOJOClass.java (working copy)
> @@ -86,6 +86,10 @@
> return StringHelper.unqualify(getMappedClassName());
> }
>
> + public String getShortNamePlural() {
> + return ReverseEngineeringStrategyUtil.simplePluralize(getShortName());
> + }
> +
> public String getQualifiedDeclarationName() {
> String generatedName = getMetaAsString( MetaAttributeConstants.GENERATED_CLASS );
> if ( generatedName == null || generatedName.trim().length() == 0 ) {
> Index: java/org/hibernate/tool/hbm2x/pojo/POJOClass.java
> ===================================================================
> --- java/org/hibernate/tool/hbm2x/pojo/POJOClass.java (revision 9925)
> +++ java/org/hibernate/tool/hbm2x/pojo/POJOClass.java (working copy)
> @@ -74,7 +74,8 @@
>
> public String getPackageName();
> public String getShortName();
> -
> + public String getShortNamePlural();
> +
> public Iterator getToStringPropertiesIterator();
> public Iterator getEqualsHashCodePropertiesIterator();
>
> Index: templates/seam/editorbean.java.ftl
> ===================================================================
> --- templates/seam/editorbean.java.ftl (revision 9925)
> +++ templates/seam/editorbean.java.ftl (working copy)
> @@ -1,5 +1,5 @@
> ${pojo.getPackageDeclaration()}
> -// Generated ${date} by Hibernate Tools ${version}
> +// Generated ${date} by Hibernate Tools ${version}-jab
>
> <#assign classbody>
> <#assign entityEditor = pojo.shortName.toLowerCase() + "Editor"><#assign entityFinder = pojo.shortName.toLowerCase() + "Finder"><#assign entityList = pojo.shortName.toLowerCase() + "List"><#assign entity = pojo.shortName.toLowerCase()><#assign entityClass = pojo.importType(pojo.qualifiedDeclarationName)>
> @@ -38,7 +38,7 @@
> @${pojo.importType("org.jboss.seam.annotations.In")}(required=false)
> private transient ${pojo.shortName}Finder ${entityFinder};
>
> - @${pojo.importType("org.jboss.seam.annotations.In")}
> + @${pojo.importType("org.jboss.seam.annotations.In")}(create=true)
> private transient ${pojo.importType("java.util.ResourceBundle")} resourceBundle;
>
> @${pojo.importType("org.jboss.seam.annotations.Begin")}(join=true)
> @@ -57,7 +57,7 @@
> </#if> entityManager.persist(instance);
> isNew = false;
> <#foreach property in pojo.getAllPropertiesIterator()><#if c2h.isManyToOne(property)><#assign getter = "get" + pojo.getPropertyName(property)> if (instance.${getter}()!=null) {
> - instance.${getter}().get${pojo.shortName}s().add(instance);
> + instance.${getter}().get${pojo.shortNamePlural}().add(instance);
> }
> </#if></#foreach> refreshFinder();
> return "edit${pojo.shortName}";
> @@ -72,7 +72,8 @@
> @${pojo.importType("org.jboss.seam.annotations.End")}(ifOutcome="find")
> public String delete() {
> entityManager.remove(instance);
> -<#foreach property in pojo.getAllPropertiesIterator()><#if c2h.isManyToOne(property)><#assign getter = "get" + pojo.getPropertyName(property)> instance.${getter}().get${pojo.shortName}s().remove(instance);
> +<#foreach property in pojo.getAllPropertiesIterator()><#if c2h.isManyToOne(property)><#assign getter = "get" + pojo.getPropertyName(property)>
> + instance.${getter}().get${pojo.shortNamePlural}().remove(instance);
> </#if></#foreach> refreshFinder();
> return doneOutcome;
> }
--
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
18 years, 3 months