Hibernate version: 3.3.0SP1
Name and version of the database you are using:H2DB
Hi,
I am having a view ROUTERLINK which is a join of different tables like:
ROUTERID from ROUTER.ID (PK of ROUTER table)
CUSTOMERID from COUSTOMER.ID (PK of CUSTOMER table) and
SITEID from SITE.ID (PK of SITE table)
In this view ROUTERID is going to be the unique column.
ROUTERLINK mapped to CERouterBO class
ROUTER mapped to RouterBO class
CUSTOMER mapped to CustomerBO and
SITE mapped to SiteBO
The hibernate mapping I wrote for ROUTERLINK is:
Code:
<class name="CERouterBO"
table="ROUTERLINK">
<cache usage="read-write" />
<id name="routerId" column="ROUTERID">
<generator class="foreign">
<param name="property">routerId</param>
</generator>
</id>
<one-to-one name="routerId"
class="RouterBO" constrained="true" />
<many-to-one name="customerId"
class="CustomerBO"
cascade="none" fetch="join" lazy="false" access="property"
column="CUSTOMERID" />
<many-to-one name="siteId"
class="SiteBO"
cascade="none" fetch="join" lazy="false" access="property"
column="SITEID" />
</class>
But I am getting the following exception:
java.lang.Exception: org.hibernate.HibernateException: Wrong column type in EVPN.PUBLIC.TWVROUTERLINK for column ROUTERID. Found: bigint, expected: binary(255)
at com.infovista.vistamart.evpn.server.util.ServiceLocator.initHibernate(ServiceLocator.java:106)
at com.infovista.vistamart.evpn.server.util.ServiceLocator.getHibernateSessionFactory(ServiceLocator.java:87)
at com.infovista.vistamart.evpn.server.util.HibernateUtil.getSession(HibernateUtil.java:32)
at com.infovista.vistamart.evpn.server.util.HibernateUtil.getSession(HibernateUtil.java:22)
at com.infovista.vistamart.evpn.server.dao.HibernateHandler.save(HibernateHandler.java:119)
at com.infovista.vistamart.evpn.server.dao.DBInitializer.createLookUpValues(DBInitializer.java:234)
at com.infovista.vistamart.evpn.server.dao.DBInitializer.startH2Servers(DBInitializer.java:96)
at com.infovista.vistamart.evpn.server.util.AppInitializer.contextInitialized(AppInitializer.java:43)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Please let me know what I am doing wrong.
Thanks n Regards,
Litty Preeth[/code]