title: PGpoint Hibernate (de)serialization exception
body: <p>In my database I've this table:</p>
  
  <pre><code>CREATE TABLE base_station
  (
      MCC INT NOT NULL,
      MNC INT NOT NULL,
      LAC INT NOT NULL,
      CID INT NOT NULL,
      type TEXT NOT NULL,
      geoposition point NOT NULL,
      city TEXT,
      date_created DATE,
      PRIMARY KEY ( CID, MNC, LAC, MCC ),
      FOREIGN KEY ( MNC, LAC, MCC ) REFERENCES location_area ( MNC, LAC, MCC ) ON DELETE CASCADE DEFERRABLE
  );
  </code></pre>
  
  <p>where geoposition is of POINT type. I've read that postgresql POINT should be mapped to PGpoint, but when trying do deserialize data I'm getting this exception:</p>
  
  <pre><code>org.hibernate.type.SerializationException: could not deserialize
      org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:262)
      org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306)
      org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:140)
      org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:121)
      org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:44)
      org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:67)
      org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
      org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:261)
      org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:257)
      org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:247)
      org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:332)
      org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2912)
      org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1673)
      org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1605)
      org.hibernate.loader.Loader.getRow(Loader.java:1505)
      org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:713)
      org.hibernate.loader.Loader.processResultSet(Loader.java:943)
      org.hibernate.loader.Loader.doQuery(Loader.java:911)
      org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
      org.hibernate.loader.Loader.doList(Loader.java:2526)
      org.hibernate.loader.Loader.doList(Loader.java:2512)
      org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2342)
      org.hibernate.loader.Loader.list(Loader.java:2337)
      org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
      org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
      org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
      org.hibernate.internal.SessionImpl.list(SessionImpl.java:1269)
      org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
      pl.elka.networkwatcher.dao.implemented.HibernateDAOImpl.getList(HibernateDAOImpl.java:49)
      pl.elka.networkwatcher.managers.BaseStationManager.findAll(BaseStationManager.java:25)
      pl.elka.networkwatcher.managers.BaseStationManager$$FastClassByCGLIB$$bbbd79f1.invoke(&lt;generated&gt;)
      org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
      org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
      pl.elka.networkwatcher.managers.BaseStationManager$$EnhancerByCGLIB$$30a97444.findAll(&lt;generated&gt;)
      pl.elka.networkwatcher.controllers.MainController.stations(MainController.java:61)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:601)
      org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:439)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:427)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 
  </code></pre>
  
  <p>When I remove geoposition from hibernate mapping, it works fine.
  Here is a piece of my entity class:</p>
  
  <pre><code>@Column(name = "geoposition", nullable = false)
  private PGpoint geoposition;
  </code></pre>
  
  <p>I'm using PostgreSQL 9.1 without PostGIS.
  How can i resolve this problem to get hibernate working correctly?</p>