-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Mapping Java Boolean to Oracle
PostPosted: Tue Feb 06, 2007 1:35 am 
Newbie

Joined: Thu Jan 11, 2007 2:49 am
Posts: 4
I'm trying to mapp java.lang.Boolean to Oracle char/varchar2

the details given below

ORACLE Table

Column TYPE
--------------------------
EMP_ID NUMBER(6) PK
EMP_FNAME VARCHAR2(30)
EMP_STATUS VARCHAR2(5)


Hibernate Mapping file

<class name="Employee" table="EMP">
<id name="empId" type="java.lang.Long" column="EMP_ID">
<generator class="increment"/>
</id>
<property name="empName" type="java.lang.String" column="EMP_FNAME"/>
<property name="empStatus" type="java.lang.Boolean" column="EMP_STATUS"/>
</class>

POJO Class

public Employee {

private java.lang.Long empId;
private java.lang.String empName;
private java.lang.Boolean empStatus;

public Employee() {
super();
}

public java.lang.Long getEmpId() {
return this.empId;
}
public void setEmpId(java.lang.Long empId) {
this.empId = empId;
}

public java.lang.String getEmpName() {
return this.empName;
}
public void setEmpName(java.lang.String empName) {
this.empName = empName;
}

public java.lang.Boolean getEmpStatus() {
return this.empStatus;
}
public void setEmpStatus(java.lang.Boolean empStatus) {
this.empStatus = empStatus;
}
}

How do I map java Boolean to Oracle VARCHAR2

Please Help me for this issue...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 3:11 am 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi pulikkottil

Try type ="yes_no"

_________________
Dharmendra Pandey


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 9:36 am 
Newbie

Joined: Thu Jan 11, 2007 2:49 am
Posts: 4
Hi dharmendra.pandey,

Thanks Dharmendra....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.