3 Replies Latest reply on May 22, 2009 11:13 PM by gonorrhea

    Database And Files

    israel.bgf

      That's not exactly a Seam question but, how can i save an file in a database (oracle), like a photo? Does JPA have something to help with this?


      Thanks,


      Israel

        • 1. Re: Database And Files
          gonorrhea

          https://www.hibernate.org/73.html


          also check out the @Lob JPA annotation:


          A Lob annotation specifies that a persistent property or field should be persisted as a large object to a database-supported large object type. Portable applications should use the Lob annotation when mapping to a database Lob type. The Lob annotation may be used in conjunction with the Basic annotation. A Lob may be either a binary or character type. The Lob type is inferred from the type of the persistent field or property, and except for string and character-based types defaults to Blob.

          • 2. Re: Database And Files
            israel.bgf

            Nice, and does it work well with lists too?

            • 3. Re: Database And Files
              gonorrhea

              I don't know, I have yet to actually try this.  Interesting problem you brought up.  I believe the Bauer/King book briefly covers @Lob.


              I wonder if any of the Seam distro apps save GIFs, JPEGs, etc. to HSQLDB (if HSQLDB can accommodate LOBs)?