Oracle ORDImage and EclipseLink || Hibernate -


i'm trying create orm eclipselink in java ee + oracledb application. problem don't know how map ordimage type database. tried use @struct without success.

i created 2 @struct structures:

@embeddable @struct(name = "ordsource", fields = {"localdata", "srctype", "srclocation", "srcname", "updatetime", "local"}) public class ordsourcestruct implements serializable {     private static final long serialversionuid = 1l;      @lob     @basic     @column(name = "localdata")     private byte[] localdata;     @column(name = "srctype")     private string srctype;     @column(name = "srclocation")     private string srclocation;     @column(name = "srcname")     private string srcname;     @column(name = "updatetime")     @temporal(temporaltype.date)     private date updatetime;     @column(name = "local")     private short slocal;      //getters , setters     ....... } 

and second one:

@struct(name = "ordimage", fields = {"source", "height", "width", "contentlength", "compressionformat", "mimetype"}) public class ordimagestruct implements serializable {     private static final long serialversionuid = 1l;      @column(name = "source")     private ordsourcestruct source;     @column(name = "height")     private integer height;     @column(name = "width")     private integer width;     @column(name = "contentlength")     private integer contentlength;     @column(name = "fileformat")     private string fileformat;     @column(name = "contentformat")     private string contentformat;     @column(name = "compressionformat")     private string compressionformat;     @column(name = "mimetype")     private string mimetype;      //getters , setters     ........... } 

then tried use them inside entity:

@entity @table(name = "zdjecia") @xmlrootelement @namedqueries({     @namedquery(name = "zdjecia.findall", query = "select z zdjecia z"),     @namedquery(name = "zdjecia.findbyid", query = "select z zdjecia z z.id = :id")}) public class zdjecia implements serializable {     private static final long serialversionuid = 1l;     @id     @basic(optional = false)     @notnull     @column(name = "id")     private short id;     @column(name = "zdjecie")     private ordimagestruct zdjecie;     @joincolumn(name = "grzyb", referencedcolumnname = "id")     @manytoone(optional = false)     private grzyby grzyb;      //getters , setters     ........... } 

but result when i'm trying display data ordimagestruct type is:

exception description: object [[ljava.lang.object;@2921ef9], of class [class [ljava.lang.object;], mapping  [org.eclipse.persistence.mappings.directtofieldmapping[zdjecie-->zdjecia.zdjecie]]  descriptor [relationaldescriptor(com.rmsbd.entities.zdjecia -->  [databasetable(zdjecia)])], not converted [class [b]. 

what doing wrong? there other way map ordimage? think handle other orm solution doesn't have eclipselink. important me these ordimage data database application.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -