users@glassfish.java.net

JPA and XMLType

From: <glassfish_at_javadesktop.org>
Date: Wed, 09 May 2007 14:47:17 PDT

hi all,

i try to create a table with XMLType Column like:
CREATE TABLE XmlStore
(
 id NUMBER NOT NULL,
 source VARCHAR2(20),
 image XMLType,
 thumbNail XMLType,
CONSTRAINT PK_XmlStore PRIMARY KEY (id)) ;
using Java Persistence API (JPA), DOA Oracle 10g, but i donĀ“t know how to write a Entity class(XMLType):
 

import oracle.toplink.essentials.*;

import javax.persistence.*;

import oracle.xdb.XMLType;


@Entity

public class XMLStore {


@Id

@GeneratedValue(strategy=GenerationType.TABLE)

private long id;


@Column(length=30)

private String source;

@Column()

private XMLType image;

@Column()

private XMLType thumbNail;


public long getId() {

return id;

}

public String getSource() {

return source;

}

public void setSource(String source) {

this.source = source;

}


public XMLType getImage(){

return image;

}

public void setImage(XMLType image){

this.image=image;

}


public XMLType getThumbNail(){

return thumbNail;

}

public void setThumbNail(XMLType thumbNail){

this.thumbNail=thumbNail;

}

public XMLStore(String source, XMLType image, XMLType thumbNail) {

this.source = source;

this.image = image;

this.thumbNail = thumbNail;

}

}
can you help me?

Cheers

Olidong
[Message sent by forum member 'olidong' (olidong)]

http://forums.java.net/jive/thread.jspa?messageID=216227