Hi,
I got the solution for this problem.
change the postgresql column type into bytea and change the pojo class like
below
/**
* @hibernate.property column="data" not-null="true" type="binary"
*/
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
then it will work perfectly....
sudhakargupta wrote:
>
> Hi Matt,
> I am using appfuse1.9 with postgresql database v8.x, I need to save xml
> structured data in database, to implement this requirement
> 1) i create a table column with OID type in database
> 2) written the pojo class code like
> /**
> * @hibernate.propety column="data" not-null="true"
> */
> public Blob getData() {
> return data;
> }
> public void setData(Blob data) {
> this.data = data;
> }
>
> public void getDataBytes(byte[] bytes) {
> Blob blob = Hibernate.createBlob(bytes);
> this.data = blob;
> }
>
> 3) In Action class i pass the value like this:
> x.getDataBytes(s.getBytes());
> 4) it saved perfectly in the database, but in database it contains the
> number value like 510242
>
> how to get the stored xml data from database.
>
> 5) in the other case i uses the sql datatype is bytea, then it throws an
> exception like batch update is failed.
> 6) in the other case i uses the x-doclet annotation type="blob", it is not
> creates a problem.
>
> can you please suggest me to solve this problem.
>
>
>
-----
---
Sudhakar
--
View this message in context:
http://www.nabble.com/Postgresql-BLOB-data-saving-problem-tp24568688s2369p24569539.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]