Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For this kind of problems, it usually helps to provide the version of the JDBC driver and the dialect you're using.</p> <p>Anyway, my understanding is that you actually want the following mapping (for DATE <strong>and</strong> TIME):</p> <pre><code>@Column(name = "READING_DATE") @Temporal(TemporalType.TIMESTAMP) private Date readingDate; </code></pre> <p>And the problem you're facing is somehow related to the madness introduced by Oracle with version 9.2, see <a href="http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#08_01" rel="noreferrer">What is going on with DATE and TIMESTAMP?</a> (in short, they introduced a <code>TIMESTAMP</code> column and changed the mapping of the <code>DATE</code> SQL type, read the FAQ). There are several options to solve it (I am of course assuming you are using a <code>TemporalType.TIMESTAMP</code> mapping):</p> <p>Either use a <code>TIMESTAMP</code> <strong>column type</strong> (I don't mean <code>TemporalType.TIMESTAMP</code> here, I really mean the column type on the DB side). But if you don't need nanosecond precision, this is not the best choice.</p> <p>Or set the <code>oracle.jdbc.V8Compatible=true</code> compatibility mode, either as system property or as a connection property:</p> <pre><code>&lt;property name="hibernate.connection.oracle.jdbc.V8Compatible"&gt;true&lt;/property&gt; </code></pre> <p>Yes, you can set arbitrary connection properties like this. From the Hibernate documentation:</p> <blockquote> <h3><a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-hibernatejdbc" rel="noreferrer">3.3. JDBC connections</a></h3> <p>...</p> <p>Arbitrary connection properties can be given by prepending "hibernate.connection" to the connection property name. For example, you can specify a <code>charSet</code> connection property using <code>hibernate.connection.charSet</code>. </p> </blockquote> <p>Or use Oracle JDBC 11.1 driver (they "fixed" the problem by reverting the change). This is IMO the ideal solution (the <code>V8Compatible</code> stuff is deprecated).</p> <h3>Related issue</h3> <ul> <li><a href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-1566" rel="noreferrer">HHH-1566</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload