users@glassfish.java.net

insert blob error in postgreSQL 8.2

From: <glassfish_at_javadesktop.org>
Date: Thu, 10 Jan 2008 22:59:23 PST

Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: column "photo" is of type bytea but expression is of type oid
Error Code: 0
Call: INSERT INTO EMPLOYEES (id, NAME, PHOTO) VALUES (?, ?, ?,
        bind => [2, tom, null,]
Query: InsertObjectQuery(Employee[id=2, name=tom])
        at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)

my class is :

@Entity
public class Employee {
          
           String id;
           String name;
           byte[] photo;

                  @Id
        @Column(name = "id")
        @GeneratedValue
        public String getId() {
                return id;
        }

        public void setId(final String id) {
                this.id = id;
        }

                    public void setName(final String name) {
                this.name = name;
        }

        @Column(nullable=false)
        public String getName() {
                return name;
        }
                
        @Lob
        public byte[] getPhoto() {
                return photo;
        }

        public void setPhoto(byte[] photo) {
                this.photo = photo;
        }
            

}
[Message sent by forum member 'easyjava' (easyjava)]

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