facebook

How can I use a Blob with the Hibernate Wizard?

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #211134 Reply

    Thomas Trostel
    Participant

    Hmm … Are there plans to add hibernate meta-data editor? Obviously we can export classes and after some fiddling I can use that feature pretty well now. It would be useful also to specify one-to-one, one-to-many, and many-to-many relationships between the tables in an existing schema. Thats probably a fairly ambitious goal. I believe Middlegen does that now so it *can* be done. Having it in the GUI with the rest of the tools would really make for some tremendous time savings.

    Keep up the good work. Like everything a lot so far.

    Tom

    #211137 Reply

    Riyad Kalla
    Member

    Tom I’ll send your request along to our Hibernate guy, thank you for taking the time to tell us what ou wanted to see.

    #211155 Reply

    support-jeff
    Member

    heh-heh-heh! you wish! Seriously, this is part of the goal, but not for 3.8 GA at this point. I will add the request to bugzilla so we can track. I will be doing this before I die…. 😉

    #211158 Reply

    Riyad Kalla
    Member

    I will be doing this before I die…. Wink

    Hahha, Jeff got put in charge of one of the most requested features, poor guy…

    #211205 Reply

    Thomas Trostel
    Participant

    LOL well if you got it done for the 3.8 GA release I’m nominating you for miracle worker of the year. Honestly just so long as its on the radar in the future is cool.

    #211212 Reply

    Riyad Kalla
    Member

    Honestly just so long as its on the radar in the future is cool.

    Sorry, we feel ME already has too many features, we are going to focus on Javadocing our code for the 3.9 and 4.0 series 😀

    #254820 Reply

    gzhuye
    Member

    From: http://hansonchar.blogspot.com/2005/06/oracle-blob-mapped-to-byte-in.html

    Here is one solution:
    1. Keep an internal member field for the byte[] image, with the standard {get|set}Image methods;
    2. Add a pair of {get|set}ImageBlob methods for getting and setting the Blob datatype, without the repsective Blob member field. This pair of methods are intended to be invoked only by Hibernate;
    3. Change the property mapping from “image” to “imageBlob”, and use “blob” instead of “binary” for the type in the Hibernate mapping file.

    Now the blob can be written to and read back from Oracle as byte[] as expected.

    Note, with this approach, you may need to use the Oracle 10.1.0.4+ JDBC thin driver regardless to get around a problem related to the blob size greater than 2K bytes (even if you are running the Oracle 9.2.0.x database). Apparently it’s related to a bug in the 9.2.0.x JDBC driver.

Viewing 7 posts - 16 through 22 (of 22 total)
Reply To: How can I use a Blob with the Hibernate Wizard?

You must be logged in to post in the forum log in