I guess you should map it as org.apache.cayenne.access.types.CharType
Amedeo > On 31 Oct 2020, at 15:51, Giuseppe De Rosa <[email protected]> wrote: > > I'm trying to make a simple select query but receive this error: > > java.io.StreamCorruptedException: invalid stream header: 78780A1F > at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857) > > In datamap I have a db-attribute of type CLOB that I want read as a simple > String. > > <db-entity name="DISC"> > <db-attribute name="DATE" type="TIMESTAMP" isMandatory="true" > length="7"/> > <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" > isMandatory="true"/> > <db-attribute name="FLAG" type="VARCHAR" isMandatory="true"/> > <db-attribute name="REQUEST" type="CLOB" isMandatory="false"/> > <db-key-generator> > <db-generator-type>ORACLE</db-generator-type> > <db-generator-name>DISC_SEQ</db-generator-name> > <db-key-cache-size>1</db-key-cache-size> > </db-key-generator> > </db-entity> > <obj-entity name="Disc" className="it.pack.dao.Disc" dbEntityName="DISC"> > <obj-attribute name="date" type="java.time.LocalDateTime" > db-attribute-path="DATE"/> > <obj-attribute name="id" type="java.lang.Integer" > db-attribute-path="ID"/> > <obj-attribute name="flag" type="java.lang.String" > db-attribute-path="FLAG"/> > <obj-attribute name="request" type="java.lang.String" > db-attribute-path="REQUEST"/> > </obj-entity> > > I think that CLOB cannot map to java.lang.String but how can I read it?
