Announcement Announcement Module
No announcement yet.
Oracle AQ: mapping String to CLOB with StructMapper Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Oracle AQ: mapping String to CLOB with StructMapper

    Hi all,
    Today i tried to enqueue an Oracle_queue using JmsTemplete. My oracle object contains clob while my java object contains String. With the spring converter I got a Jms exception telling me that type is not identical with the struct attribute (means String to CLOB). What I did is implementing DatumMapper and override toDatum function, so like that I did convert String to Clob:
    Function toDatum(......){
    java.sql.Clob clob= connection.createClob();
    clob.setString(1, objecToConvert.getStringAttrOne());
    // here I create a StructDescriptor
    STRUCT struct = new STRUCT(StructDescriptor type, java.sql.Connection conn, new Object[] {clob});
    return struct;
    But I don't like this solution because it's not clean and we need to create a mapper per object
    Do you have please any genius idea more clean and loosely coopled ? Or si spring data offering some kind of jpa mapping Like Hibernate ...?
    Tomorrow I will see if I can create an abstract factory to do generic mapping.

  • #2
    Sorry for not getting to this sooner. We are in the process of moving to StackOverflow for our forums.

    This question is probably a better candidate for StackOverflow, perhaps against the #spring-jms, #oracle tag.
    If you do post it there, please reply here with the link.