Note that there are some explanatory texts on larger screens.

plurals
  1. POJava DataType mismatch between Oracle and hibernate
    primarykey
    data
    text
    <p>My java application is using hibernate with Oracle 10g as the database. I have landed into an issue and not able to proceed and i need your help here. Below is the issue that i am facing.</p> <p>I have a Column in one of my Oracle table which has a datatype of <code>Varchar2(1 byte)</code>. I want to know the proper dataype that i need to use in my pojo class. Also in the hibernate mapping file what should be the datatype for the same property. when i am running the file hibernate keeps on giving error like cannot do a conversion. below are my pojo and <code>.hbm</code> file</p> <pre><code>public class destination implements Serializable{ private String configId; private String isCurrent; //other properties and getter, setters } </code></pre> <p>destination.hbm.xml</p> <pre><code>&lt;class name="com.testing" table="configuration"&gt; &lt;id name="configID" type="java.lang.Integer"&gt; &lt;column name="configuration_id" /&gt; &lt;generator class="identity" /&gt; &lt;/id&gt; &lt;property name="isCurrent" type="Not-SURE"&gt; &lt;column name="is_current" not-null="true" /&gt; &lt;/property&gt; </code></pre> <p>The column i am talking about is the <code>isCurrent</code> property in the pojo and <code>.hbm.xml</code> file. Its defined as <code>Varchar2(1 byte)</code> in the db. I ma not sure about the datatype and marked it a <code>String</code> but the issue still persists.</p> <p>I have searched the net but have not got any proper solution for this issue.</p> <p>Can you please help me here as its really eating my head a lot.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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