How do I override ActiveModel type processing in Rails (JRuby)
I'm trying to create a rails model around an oracle table that has a column "SESSION_XML" using Oracle's XMLTYPE. Whenever I attempt to use the model to get data from the db, the connection adapter responds with:
SELECT "ZC_SESSION_DATA".* FROM "ZC_SESSION_DATA" WHERE ROWNUM <= 1 ActiveRecord::StatementInvalid: Java::JavaLang::NoClassDefFoundError: oracle/xdb/XMLType:SELECT "ZC_SESSION_DATA".* FROM "ZC_SESSION_DATA" WHERE ROWNUM <= 1 from oracle.jdbc.oracore.OracleTypeADT.applyTDSpatches(OracleTypeADT.java:1081)
It seems clear to me that Java (I'm using Rails on top of JRuby) is complaining that it doesn't have a type with which to parse the XMLTYPE column, so my question is this: How can I force rails to interpret the XMLTYPE as a flat string.
I'm fine with needing to parse the XML myself, but how do I get the adapter to stop trying to parse it?
This is an Oracle problem, not really an ActiveRecord problem:
TL;DR there's a jar that isn't being loaded that defines XMLType.