Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Problem with JPA and User-defined type in Oracle
Problem with JPA and User-defined type in Oracle [message #1096786] Wed, 28 August 2013 17:36
Ivan Krstic is currently offline Ivan Krstic
Messages: 1
Registered: August 2013
Junior Member
hi,

i have user-defined type in oracle db:
create or replace 
TYPE "OBJ_NOSILAC_OSIGURANJA" AS OBJECT (
  INSURANCE_HOLDER CHAR(1),
  INSURANCE_HOLDER_FIRSTNAME VARCHAR2(30),
  INSURANCE_HOLDER_LASTNAME VARCHAR2(30),
  INSURANCE_HOLDER_P_NUMBER VARCHAR2(13),
  INSURANCE_HOLDER_INSURANCE VARCHAR2(11),
  MEMBER FUNCTION get_INSURANCE_HOLDER RETURN CHAR,
  MEMBER FUNCTION get_INSURANCE_HOLDER_FIRSTNAME RETURN VARCHAR2,
  MEMBER FUNCTION get_INSURANCE_HOLDER_LASTNAME RETURN VARCHAR2,
  MEMBER FUNCTION get_INSURANCE_HOLDER_P_NUMBER RETURN VARCHAR2,
  MEMBER FUNCTION get_INSURANCE_HOLDER_INSURANCE RETURN VARCHAR2
) instantiable not final;


also, i have table that use that type:
CREATE TABLE "DENTIST"."PATIENT_DETAIL" 
   (	"ID_PATIENT" NUMBER(*,0) NOT NULL ENABLE, 
	"INSURANCE_HOLDER" "DENTIST"."OBJ_NOSILAC_OSIGURANJA" ,......)


in my procest, i used JPA with eclipselink 2.5.0 and have entity java class:
@Entity
@Table(name="patient_detail")
public class Patient {
  private Integer id_patient;
  ....

  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  public Integer getId_patient() {
 	return id_patient;
  }

  public void setId_patient(Integer id_patient) {
	this.id_patient = id_patient;
  }


i don't know how to use field in my class with user-defined type in oracle db?
Previous Topic:Regression 2.4.1 -> 2.4.2
Next Topic:[resolved] Problem with Inserting/Updating in DescriptorEventListener callback methods
Goto Forum:
  


Current Time: Thu Aug 28 07:18:57 EDT 2014

Powered by FUDForum. Page generated in 0.10327 seconds