Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Please help custom UserType produces could not deserialize
PostPosted: Sun Jan 21, 2007 11:30 pm 
Newbie

Joined: Mon Nov 20, 2006 8:32 pm
Posts: 3
I am using custom user types provide in this thread SqlArray and ListAsSQLArrayUserType

here's my mapping

<property name="timeArray" type="com.timestock.tess.util.ListAsSQLArrayUserType$INTEGER" >
<column name="time_array" sql-type="int[]" />
</property>

But I get the following exception. I am just trying to read an int4[] column from a postgres db. What am I doing wrong? I am not interested in persisting this data just reading it. Is there another way I can do this?


org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:217)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)
at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)
at org.hibernate.type.SerializableType.get(SerializableType.java:39)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2046)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1371)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1299)
at org.hibernate.loader.Loader.getRow(Loader.java:1197)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
at org.hibernate.loader.Loader.doQuery(Loader.java:689)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150)
at com.timestock.tess.data.dao.BizEventDAO$6.doInHibernate(BizEventDAO.java:223)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
at com.timestock.tess.data.dao.BizEventDAO.getDefectTimeDistByUserGroup(BizEventDAO.java:214)
at com.timestock.tess.services.managers.EventManager.getDefectTimeDistByUserGroup(EventManager.java:245)
at com.timestock.tess.services.managers.EventManager$$FastClassByCGLIB$$c56b9d16.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:608)
at com.timestock.tess.services.managers.EventManager$$EnhancerByCGLIB$$e64a488c.getDefectTimeDistByUserGroup(<generated>)
at com.timestock.tess.web.controllers.BizEventTroubleshootController.referenceData(BizEventTroubleshootController.java:184)
at org.springframework.web.servlet.mvc.AbstractFormController.showForm(AbstractFormController.java:559)
at org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:198)
at org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:175)
at org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:323)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:263)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.timestock.tess.services.licensing.LicenseFilter.doFilter(LicenseFilter.java:92)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)
at org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:753)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:268)
at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:252)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:209)
... 81 more


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 22, 2007 6:09 am 
Newbie

Joined: Fri Dec 29, 2006 2:28 pm
Posts: 11
Hi lnader!
I've tried the SqlArray and ListAsSQLArrayUserType way, but I wasn't able... so I mapped my float[] as a bytea (it works even with int[] :-)
Here is my code:


Star.java

Code:
package popolamento;

/**
* Classe Spectra.
*
* Rappresentazione di spettri stellari sintetici
* che copre un vasto spazio di parametri fisici
* (temperatura, gravit&agrave; superficiale, velocit&agrave;
* di rotazione, etc) e non (risoluzione, normalizzazione, etc).
*/

public class Spectra {

    private Long id;
    private String teff;
    private int logg;
    private String feh;
    private int vrot;
    private int k;
    private String alpha;
    private String odf;
    private String res;
    private String tipo;
    private float[] data;

    /**
     * Costruttore di spettro vuoto
     */
    public Spectra() {}

    /**
     * Accede all'attributo.
     *
     * @return  <code>long</code> il valore del campo
     */
    public Long getId() {
        return id;
    }
    /**
     * Modifica l'attributo.
     *
     * @param id il valore da dare al campo
     */
    private void setId(Long id) {
        this.id = id;
    }

    /**
     * Accede alla temperatura effettiva.
     *
     * @return  <code>String</code> il valore del campo
     */
    public String getTeff() {
        return teff;
    }
    /**
     * Modifica la temperatura effettiva.
     *
     * @param teff il valore da dare al campo
     */
    public void setTeff(String teff) {
        this.teff = teff;
    }

    /**
     * Accede alla gravit&agrave; superficiale.
     *
     * @return  <code>int</code> il valore del campo
     */
    public int getLogg() {
        return logg;
    }
    /**
     * Modifica la gravit&agrave; superficiale.
     *
     * @param logg il valore da dare al campo
     */
    public void setLogg(int logg) {
        this.logg = logg;
    }

    /**
     * Accede alla metallicit&agrave;.
     *
     * @return  <code>String</code> il valore del campo
     */
    public String getFeh() {
        return feh;
    }
    /**
     * Modifica la metallicit&agrave;.
     *
     * @param feh il valore da dare al campo
     */
    public void setFeh(String feh) {
        this.feh = feh;
    }

    /**
     * Accede alla velocit&agrave; rotazionale.
     *
     * @return  <code>int</code> il valore del campo
     */
    public int getVrot() {
        return vrot;
    }
    /**
     * Modifica la velocit&agrave; rotazionale.
     *
     * @param vrot il valore da dare al campo
     */
    public void setVrot(int vrot) {
        this.vrot = vrot;
    }

    /**
     * Accede alla microturbulent velocity.
     *
     * @return  <code>int</code> il valore del campo
     */
    public int getK() {
        return k;
    }
    /**
     * Modifica la microturbulent velocity.
     *
     * @param k il valore da dare al campo
     */
    public void setK(int k) {
        this.k = k;
    }

    /**
     * Accede all'enhancement.
     *
     * @return  <code>String</code> il valore del campo
     */
    public String getAlpha() {
        return alpha;
    }
    /**
     * Modifica l'enhancement.
     *
     * @param alpha il valore da dare al campo
     */
    public void setAlpha(String alpha) {
        this.alpha = alpha;
    }

    /**
     * Accede al modello ODF.
     *
     * @return  <code>String</code> il valore del campo
     */
    public String getOdf() {
        return odf;
    }
    /**
     * Modifica il modello ODF.
     *
     * @param odf il valore da dare al campo
     */
    public void setOdf(String odf) {
        this.odf = odf;
    }

    /**
     * Accede alla risoluzione.
     *
     * @return  <code>String</code> il valore del campo
     */
    public String getRes() {
        return res;
    }
    /**
     * Modifica la risoluzione.
     *
     * @param res il valore da dare al campo
     */
    public void setRes(String res) {
        this.res = res;
    }

    /**
     * Accede al tipo (fluxed o normalized).
     *
     * @return  <code>String</code> il valore del campo
     */
    public String getTipo() {
        return tipo;
    }
    /**
     * Modifica il tipo (fluxed o normalized).
     *
     * @param tipo il valore da dare al campo
     */
    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    /**
     * Accede ai dati.
     *
     * @return  <code>float[]</code> il valore del campo
     */
    public float[] getData() {
        return data;
    }
    /**
     * Modifica i dati.
     *
     * @param data il valore da dare al campo
     */
    public void setData(float[] data) {
        this.data = data;
    }

}



Star.hbm.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

    <class name="popolamento.Spectra" table="SPECTRA">
        <id name="id" column="ID">
            <generator class="native"/>
        </id>
    <property name="teff">
        <column name="TEFF" sql-type="CHAR(5)"/>
    </property>
    <property name="logg">
       <column name="LOGG" sql-type="SMALLINT"/>
    </property>
    <property name="feh">
        <column name="FEH" sql-type="CHAR(4)"/>
    </property>
    <property name="vrot">
       <column name="VROT" sql-type="SMALLINT"/>
    </property>
    <property name="k">
       <column name="K" sql-type="SMALLINT"/>
    </property>
    <property name="alpha">
        <column name="ALPHA" sql-type="CHAR(1)"/>
    </property>
    <property name="odf">
        <column name="ODF" sql-type="CHAR(2)"/>
    </property>
    <property name="res">
        <column name="RES" sql-type="CHAR(3)"/>
    </property>
    <property name="tipo">
        <column name="TIPO" sql-type="CHAR(1)"/>
    </property>
    <property name="data"/>
    </class>

</hibernate-mapping>



SpectraLoader.java

Code:
package popolamento;

import java.io.*;
import java.util.zip.*;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.HibernateUtil;

/**
* Classe SpectraLoader.
*
* Carica in un database tutti i file trovati, a partire dalla posizione
* attuale o dalla cartella indicata, il cui nome soddisfi la seguente codifica:
* T([0-9]{5})G([0-5]{2})([MP])([0125]{2})V([0123457]{3})K([124])([SA])(NW|OD)NV(R20|RVS|RAV|SLN|D01|D10)[NF].ASC.gz
*
* @see popolamento.DirBrowser
*/

public class SpectraLoader {

    public static void main(String[] args) {

        SpectraLoader spl = new SpectraLoader();
        // se non viene passato nessun percorso, parte dalla cartella di lavoro
        File f = new File(".");
        if (args.length!=0 && !args[0].equals("${action}"))
            f = new File(args[0]);
        // scansione delle cartelle dirBrowser(f, spl);
        DirBrowser.subfolder(f, spl);
        HibernateUtil.getSessionFactory().close();
    }

    /**
     * Crea e salva uno spettro nel database.
     *
     * @param f file da caricare
     * @exception IOException se il file non viene trovato
     * @exception HibernateException se si perde la connessione al database
     */
    protected void createAndStoreSpectra(File f) {
        // dal nome del file risale alle caratteristiche
        String nome = f.getName();
        nome = nome.toUpperCase();
        String teff = nome.substring(1,6);
        String logg = nome.substring(7,9);
        String segno = "+";
        if (nome.substring(9,10).equals("M"))
            segno = "-";
        String feh = segno + nome.charAt(10) + "." + nome.charAt(11);
        String vrot = nome.substring(13,16);
        String k = "" + nome.charAt(17);
        String alpha = "" + nome.charAt(18);
        String odf = nome.substring(19,21);
        String res = nome.substring(23,26);
        String tipo = "" + nome.charAt(26);
        float[] data = null;

        try { // apre il file compresso e conta le righe
            String inFilename = f.getCanonicalPath();
            BufferedReader gzipReader = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(inFilename))));
            String linea = gzipReader.readLine();
            int j = 0;
            while(linea!=null) {
                linea = gzipReader.readLine();
                j++;
            }
            // mette il contenuto dentro un array
            data = new float[j];
            gzipReader = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(inFilename))));
            linea = gzipReader.readLine();
            j = 0;
            while(linea!=null) {
                data[j] = Float.valueOf(linea).floatValue();
                linea = gzipReader.readLine();
                j++;
            }
            gzipReader.close();  // chiude il file gzip
        } catch (IOException e) {
            System.out.println("ERRORE! " + e);
        }

        // carica nel database
      Transaction tx = null;
      Session session = HibernateUtil.getSessionFactory().getCurrentSession();
      try {
         tx = session.beginTransaction();
           Spectra spectrum = new Spectra();
           spectrum.setTeff(teff);
           spectrum.setLogg(Integer.parseInt(logg));
           spectrum.setFeh(feh);
           spectrum.setVrot(Integer.parseInt(vrot));
           spectrum.setK(Integer.parseInt(k));
           spectrum.setAlpha(alpha);
           spectrum.setOdf(odf);
           spectrum.setRes(res);
           spectrum.setTipo(tipo);
           spectrum.setData(data);
           session.save(spectrum);
         tx.commit();
      } catch (HibernateException e) {
         e.printStackTrace();
         if (tx != null && tx.isActive())
            tx.rollback();
      }
    }

}



SpectraView.java

Code:
package popolamento;

import java.util.List;
import org.hibernate.Session;
import util.HibernateUtilView;

/**
* Classe SpectraLoader.
*
* Accede al database e recupera tutti gli spettri inseriti,
* stampandone a video i parametri.
*/

public class SpectraView {

    public static void main(String[] args) {
        SpectraView spw = new SpectraView();
        // recupera gli spettri nel database
        List splist = spw.listSpectra();
        // stampa a video le caratteristiche e i dati
        for (int i = 0; i < splist.size(); i++) {
            Spectra spectrum = (Spectra) splist.get(i);
            float[] data = spectrum.getData();
            System.out.println("Teff  = "+spectrum.getTeff());
            System.out.println("Logg  = "+spectrum.getLogg());
            System.out.println("Fe_H  = "+spectrum.getFeh());
            System.out.println("VRot  = "+spectrum.getVrot());
            System.out.println("K     = "+spectrum.getK());
            System.out.println("Alpha = "+spectrum.getAlpha());
            System.out.println("ODF   = "+spectrum.getOdf());
            System.out.println("Res   = "+spectrum.getRes());
            System.out.println("Tipo  = "+spectrum.getTipo());
            System.out.println("Data  =");
            for (int j = 0; j < data.length; j++)
                System.out.println(data[j]);
            System.out.println("-----*****-----*****-----");
        }
        HibernateUtilView.getSessionFactory().close();
    }

    /**
     * Interroga il database e recupera un oggetto List contenente tutte
     * le tuple presenti.
     *
     * @return  <code>List</code> lista degli spettri presenti nel database
     */
    private List listSpectra() {
        // estrae una lista delle tuple presenti nel database
        Session session = HibernateUtilView.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List result = session.createQuery("from Spectra").list();
        session.getTransaction().commit();
        return result;
    }

}


PS: please don't forget to give credits below if you found this answer useful :)

_________________
F/\B!O


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Fri Nov 13, 2009 11:48 am 
Newbie

Joined: Fri Nov 13, 2009 11:46 am
Posts: 1
thanks Sylvain for sharing the solution to this issue.


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Thu Mar 24, 2011 1:34 pm 
Newbie

Joined: Thu Mar 24, 2011 1:30 pm
Posts: 1
Hello,

I am using the solution by Sylvain, and I am very happy with it.

But now, I have to use it for Enums, and I would like to know what is the "ENUM_LIST" class ?


thanks for all, and sorry for bumping this old post.


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Sat Mar 26, 2011 11:18 am 
Newbie

Joined: Wed Feb 08, 2006 12:29 pm
Posts: 2
Similarly to Favio, I'm trying to figure out how to get data in and out of a POJO class's member variable ListAsSQLArrayUserType.STRING. In this case, legacy (Ruby) code is mapping a set of states (US) as varchar(2) [], and I need to be able to handle it in Java. I see the ListAsSQLArrayUserType class defn, but it's opaque as far as a class declaring

protected ListAsSQLArrayUserType.STRING states = null

and then trying to get individual elements in and out of that array post-fetch is concerned - or putting them back in. Do I need to extend the (static) class, to get the SQLArray back? The only getter/setter I see is a) protected and b) called with an Object which it maps. That doesn't help me in a model class which not only is serialized and de-serialized by Hibernate, but also must be used in a view. I've written a couple of UserTypes myself to persist something Hibernate doesn't, and mine provided public getter/setter methods to get a the deserialized data. What am I missing?

Thanks - Dave


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Tue Mar 29, 2011 6:06 pm 
Newbie

Joined: Wed Feb 08, 2006 12:29 pm
Posts: 2
D'OH! is all I can say.

I finally figured out the proper Java mapping. The ListAsSQLArrayUserType class is not the Java field data type I wanted to use, it’s a helper class type that converts a Postgres Array to a Java ArrayList<E> and back. My misunderstanding. The UserType I wrote a long time time ago when I was first working with Hibernate for does both – it’s the field type and the conversion agent. ListAsSQLArrayUserType is just the helper, which is Hibernate's recommended pattern. Once I realized that it took 10 minutes to get it working.

Thanks, Sylvain, for the contribution!

By the way, this works with Hibernate annotations now. Class member def:
Code:
    protected ArrayList<String>                 theStates                = null; // VARCHAR(2)[]


Getter with annotations:

Code:
    @Column(name="theStates", nullable=true, columnDefinition="varchar(2)[]" )
    @Type(type="com.seanergie.persistence.ListAsSQLArrayUserType$STRING" )
    public ArrayList<String> getTheStates()
    { ....


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Sat May 07, 2011 9:30 am 
Newbie

Joined: Sat May 07, 2011 9:12 am
Posts: 1
hello everybody,

I have the some probleme with postgresql and I want to use the ListAsSQLArrayUserType class to store a double array in my database

so can i know how have you done it please

note: I use JPA too so i don't know if we can have the some solution?


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Wed Apr 18, 2012 8:51 am 
Newbie

Joined: Wed Apr 18, 2012 8:44 am
Posts: 5
cannot find symbol
symbol : variable SessionManager
location: class com.netree.SqlArray<T>
return SessionManager.getSettings().getDialect().getTypeName( baseType );[size=200][size=150][/size][/size]



I am facing this problem. Please help me. How can I resolve this?

Advance Thax.


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Wed Apr 18, 2012 8:54 am 
Newbie

Joined: Wed Apr 18, 2012 8:44 am
Posts: 5
cannot find symbol
symbol : variable SessionManager
location: class com.netree.SqlArray<T>
return SessionManager.getSettings().getDialect().getTypeName( baseType );

Please help me ..I am facing this problem.. How can I Resolve this Error


Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Fri Jul 27, 2012 5:04 am 
Newbie

Joined: Thu Jul 26, 2012 7:01 am
Posts: 5
regret

Amit


Last edited by amitguptanic on Mon Aug 27, 2012 2:45 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Fri Jul 27, 2012 5:08 am 
Newbie

Joined: Thu Jul 26, 2012 7:01 am
Posts: 5
regret

Amit


Last edited by amitguptanic on Mon Aug 27, 2012 2:46 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Fri Jul 27, 2012 6:47 am 
Newbie

Joined: Thu Jul 26, 2012 7:01 am
Posts: 5
regret

Amit


Last edited by amitguptanic on Mon Aug 27, 2012 2:45 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Fri Jul 27, 2012 7:01 am 
Newbie

Joined: Thu Jul 26, 2012 7:01 am
Posts: 5
Amit


Last edited by amitguptanic on Mon Aug 27, 2012 2:44 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: int[] in a single column
PostPosted: Mon Aug 27, 2012 2:43 am 
Newbie

Joined: Thu Jul 26, 2012 7:01 am
Posts: 5
Hi
I have tried using ListAsSQLArrayUserType and SQLArray

But in DAO when I fetch the records using list method


I get
org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling the setter method
of test.app.model.TestDetail.sectionList

what is the reaon

can you send the DAO java file so that I can understand how to use it


regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

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.