facebook

Want to use stream with JPA Blob

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #287896 Reply

    tigato
    Member

    I’d like to use a stream to efficiently stream large BLOBs out of a database with JPA. I’m trying to us JPA reverse engineering feature, but it turns my BLOBs into byte arrays which would have to be brought completely into memory. Is there a way to use the jpa.reveng.xml to use streams instead? I tried to designate the type of the field as InputStream like I saw at OpenJPA, but hibernate doesn’t like that. It fails when it validates the type of the column.

    Caused by: org.hibernate.MappingException: Could not determine type for: java.io.InputStream, for columns: [org.hibernate.mapping.Column(contents)]
    at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
    at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
    at org.hibernate.mapping.Property.isValid(Property.java:185)
    at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
    at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
    at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
    … 31 more

    #287924 Reply

    Loyal Water
    Member

    Moving to Off Topic >> Software Development.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Want to use stream with JPA Blob

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