Re: XMLTYPE ?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Dec 08 2004 - 10:01:14 EST

  • Next message: Andrus Adamchik: "TheServerSide Cayenne Thread"

    I see... "column.getclobval()" converts XML type to a straight CLOB which
    of course works with Cayenne. Thank god for SQLTemplate ;-)

    Actually Derived DbEntity (that you can create in the Modeler) would allow
    to define a column as "xyz.getclobval()", though I am itching to deprecate
    DerivedDbEntity and move this functinality to regular DbEntity, so I don't
    normaly mention it.

    And of course ExtendedType solution will also work.

    Andrus

    > Hello,
    >
    >> > Is the XMLTYPE supported ? How must i map it ?
    >>
    >> As XMLTYPE is Oracle-specific extension and doesn't seem to
    >> be directly supported via JDBC, it has to be read using
    >> Oracle dirver API (yikes!):
    >>
    >> http://www.oracle.com/technology/sample_code/tech/java/codesni
    >> ppet/jsp/xmltype/GetXMLTypeVal.java.html
    >
    > A this moment i use a SQLTemplate - that works.
    >
    >> To integrate this to Cayenne (and provide mapping to any Java
    >> class you
    >> want) you'd have to implement an ExtendedType:
    >> http://objectstyle.org/cayenne/userguide/access-stack/extended
    >> -types.html
    >>
    >> Let me know if this works. I wouldn't mind adding XMLTYPE
    >> ExtendedType to Cayenne OracleAdapter.
    >
    > I tried to map it as Clob. But the SQL executed doesn't contain a
    > "column.getclobval()" in the select-list. That would be enough IMHO.
    >
    > Actually executed is "select column from table" - causing a Error
    >
    > java.sql.SQLException: Illegal column type
    > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    >
    > Should be "select column.getclobval() from table". This is what i do in
    > the SQLTemplate now.
    >
    > Regards
    > René



    This archive was generated by hypermail 2.0.0 : Wed Dec 08 2004 - 10:01:18 EST