-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: InputStream: MappingException
PostPosted: Mon Oct 04, 2004 7:06 am 
Newbie

Joined: Mon Oct 04, 2004 6:38 am
Posts: 1
hi all.

I'm new to hibernate and I tried to implement hibernate in my application. Everything works fine but I can't handle the InpustStream from jpeg files. Previously, I did it directly through the JDBC driver from MySQL (mysql-connector-java-3.0.15-ga-bin.jar) which works fine. I was able to store and read the files without any errors.

I'm using middlegen to generate my hbm.xml mappings files. The relevant code is right below. The property settings are advised from middlegen.

Code:
   
      <property
        name="transferdata"
        type="java.io.InputStream"
        column="TRANSFERDATA"
        not-null="true"
        length="2147483647"
    />


Afterwards I'm using extension tools form hibernate (hbm2java) to generate my java class.

Code:
   
public class MediaTransfer implements Serializable {

    public InputStream getTransferdata() {
        return this.transferdata;
    }

    public void setTransferdata(InputStream transferdata) {
        this.transferdata = transferdata;
    }


my hibernate.cfg.xml
Code:
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
   <session-factory>
      <property name="connection.datasource">java:DEV.MEDIAMANAGEMENTSERVICE</property>
      <property name="show_sql">false</property>
      <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
      <property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
      <!-- Mapping files -->
      <mapping resource="ch/asiva/ch/mediamanagement/internal/vo/hibernate/MediaTransfer.hbm.xml"/>
   </session-factory>
</hibernate-configuration>


when I tried to read or store data to that table, this exception occurs.
Code:
   
Caused by: net.sf.hibernate.MappingException: Could not interpret type: java.io.InputStream


I haven't found much on the about this topic and I wasn't able to get properly into hibernate now.

But I would really appreciate any information, help or solutions about this exception.

thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.