[Hibernate-JIRA] Resolved: (ANN-403) Improve Java 5 Enums dependency on old fashioned enums
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-403?page=all ]
Emmanuel Bernard resolved ANN-403:
----------------------------------
Resolution: Incomplete
no user feedback
> Improve Java 5 Enums dependency on old fashioned enums
> ------------------------------------------------------
>
> Key: ANN-403
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-403
> Project: Hibernate Annotations
> Type: Improvement
> Versions: 3.2.0.cr1
> Reporter: Amir Pashazadeh
> Priority: Minor
>
> Original Estimate: 2 hours
> Remaining: 2 hours
>
> Converting from new enum types (like FlushModeType and CacheModeType) to old enum types (which is used by Query, Critiera, and ... interfaces) is not done well, and well formed.
> By adding constructors to new enums this could be much better, and more perform!
> I will attach what must have been done in FlushModeType, the same thing must happen to CacheModeType:
> public enum FlushModeType {
> /**
> * see {@link org.hibernate.FlushMode.ALWAYS}
> */
> ALWAYS(FlushMode.ALWAYS),
> /**
> * see {@link org.hibernate.FlushMode.AUTO}
> */
> AUTO(FlushMode.AUTO),
> /**
> * see {@link org.hibernate.FlushMode.COMMIT}
> */
> COMMIT(FlushMode.COMMIT),
> /**
> * see {@link org.hibernate.FlushMode.NEVER}
> */
> NEVER(FlushMode.NEVER);
> FlushModeType(FlushMode flushMode) {
> this.flushMode = flushMode;
> }
> private FlushMode flushMode;
> /**
> * @return old type proper FlushMode
> */
> public FlushMode getFlushMode() {
> return flushMode;
> }
> }
--
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, 10 months
[Hibernate-JIRA] Moved: (HBX-873) Merging annotations and XML sometimes causes an XML parser error
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-873?page=all ]
Emmanuel Bernard moved ANN-438 to HBX-873:
------------------------------------------
Project: Hibernate Tools (was: Hibernate Annotations)
Key: HBX-873 (was: ANN-438)
Version: 3.2beta7
(was: 3.2.0.cr1)
> Merging annotations and XML sometimes causes an XML parser error
> ----------------------------------------------------------------
>
> Key: HBX-873
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-873
> Project: Hibernate Tools
> Type: Bug
> Versions: 3.2beta7
> Environment: Hibernate 3.2 CR2, SQL Server 2005
> Reporter: James Telfer
> Assignee: Max Rydahl Andersen
> Attachments: ann438.zip
>
>
> I created a class and annotated it with EJB 3 annotations, then created an XML descriptor to store my named queries. The XML I used is excerpted below. I then added the mapping file to my cfg.xml as a <mapping resource=""/%gt; element. When Hibernate was configured, it threw the parser exception included below also.
> The same error occurred when configuring my application within Tomcat (via Spring). To narrow down the problemI created a very simple class to configure Hibernate and ran that in Eclipse. This worked. The line used to configure Hibernate was: <code>new AnnotationConfiguration().configure(new File("hibernate.cfg.xml")).buildSessionFactory();</code>.
> Eclipse is running on Windows using the JDK 1.5.07 Server VM with parallel GC and the Eclipse runner used the JDK server VM with standard GC. Tomcat was using the JRE 1.5.07 client VM. I changed the VM used by Tomcat and it succeeded. Hibernate Tools still fails to read the configuration file.
> If any further information is required, I'd be happy to provide it. There is a forum thread (http://forum.hibernate.org/viewtopic.php?p=2310540&sid=f14052739a96c418c3...) that describes a similar problem, but the user's fix is not feasible in this scenario.
> <pre>
> org.hibernate.MappingException: Could not read mappings from resource: au/com/crowncontent/precis/entries/dao/mappings.xml
> at org.hibernate.cfg.Configuration.addResource(Configuration.java:523)
> at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:425)
> at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1479)
> at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
> at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1432)
> at org.hibernate.cfg.Configuration.configure(Configuration.java:1386)
> at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:225)
> at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:172)
> at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:148)
> at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
> at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:129)
> at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:109)
> at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:54)
> at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:63)
> at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
> at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
> 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:928)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
> 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.core.launcher.Main.invokeFramework(Main.java:336)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
> at org.eclipse.core.launcher.Main.main(Main.java:952)
> Caused by: org.hibernate.MappingException: invalid mapping
> at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:571)
> at org.hibernate.cfg.Configuration.addResource(Configuration.java:520)
> ... 39 more
> Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'entity-mappings'.
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1944)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
> at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
> at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
> at org.dom4j.io.SAXReader.read(SAXReader.java:465)
> at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:567)
> ... 40 more
> </pre>
> ORM XML:
> <pre>
> <entity-mappings
> xmlns="http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
> version="1.0">
> <package>au.com.blah.entries</package>
>
> <entity class="Entry" metadata-complete="false">
> <named-query name="entries.Entry.searchEntries">
> <query>
> select ...
> etc etc
> </query>
> <hint name="org.hibernate.readOnly" value="true"/>
> <hint name="org.hibernate.fetchSize" value="50"/>
> </named-query>
> </entity>
> </entity-mappings>
> </pre>
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2425) org.hibernate.impl.SessionImpl logging of open and close session inconsistent
by Don Smith (JIRA)
org.hibernate.impl.SessionImpl logging of open and close session inconsistent
-----------------------------------------------------------------------------
Key: HHH-2425
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2425
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.ga
Reporter: Don Smith
Priority: Minor
The open session log messages are at the debug level. The close session log message is at the trace level. They should be the same level.
175: log.debug( "opened session [" + entityMode + "]" );
220: log.debug( "opened session at timestamp: " + timestamp );
273: log.trace( "closing session" );
353: log.trace( "automatically closing session" );
Proposed change:
svn diff ./src/org/hibernate/impl/SessionImpl.java
Index: src/org/hibernate/impl/SessionImpl.java
===================================================================
--- src/org/hibernate/impl/SessionImpl.java (revision 11161)
+++ src/org/hibernate/impl/SessionImpl.java (working copy)
@@ -270,7 +270,7 @@
}
public Connection close() throws HibernateException {
- log.trace( "closing session" );
+ log.debug( "closing session" );
if ( isClosed() ) {
throw new SessionException( "Session was already closed" );
}
@@ -350,7 +350,7 @@
}
public void managedClose() {
- log.trace( "automatically closing session" );
+ log.debug( "automatically closing session" );
close();
}
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2424) InformixDialect uses wrong date methods mapping
by Giltal Tzabar (JIRA)
InformixDialect uses wrong date methods mapping
-----------------------------------------------
Key: HHH-2424
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2424
Project: Hibernate3
Type: Bug
Components: query-hql
Versions: 3.2.2
Environment: Informix
Reporter: Giltal Tzabar
Attachments: Informix10Dialect.java
The InformixDialect extends the Dialect class but does not replace the
date methods mappings.
To correct this bug you need to write the following lines in the dialect default constructor:
// Map second/minute/hour/day/month/year, override on subclasses
registerFunction("second", new SQLFunctionTemplate(Hibernate.INTEGER, "second(?1)"));
registerFunction("minute", new SQLFunctionTemplate(Hibernate.INTEGER, "minute(?1)"));
registerFunction("hour", new SQLFunctionTemplate(Hibernate.INTEGER, "hour(?1)"));
registerFunction("day", new SQLFunctionTemplate(Hibernate.INTEGER, "day(?1)"));
registerFunction("month", new SQLFunctionTemplate(Hibernate.INTEGER, "month(?1)"));
registerFunction("year", new SQLFunctionTemplate(Hibernate.INTEGER, "year(?1)"));
--
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, 10 months