Hi i have done all my mapping, the connection with the DB works fine when I make a query from my DAO class it returns the exact quantity of registers it must; but all the attributes are null, 0 (in case of int) or false (in case of booleans). Can anyone helpme with this issue?
Here are my xml files
applicationContext
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"a
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<import resource="database/databaseContext.xml" /> <import resource="hibernate.hbm.xml"/> </beans>
databaseContext <?xml version="1.0" encoding="UTF-8"?>
<beans xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans"> <import resource="classpath:META-INF/*-core-context.xml"/> <bean class="org.apache.commons.dbcp.BasicDataSource" id="dataSource" destroy-method="close"> <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> <property name="url" value="jdbc:sqlserver://localhost:1434;databaseName=TestDB" /> <property name="username" value="user" /> <property name="password" value="user" /> </bean> <bean class="mx.com.test.data.dao.impl.ModuleDAOImpl" id="ModuleDAO"> <property name="dataSource" ref="dataSource" /> </bean> <bean class="mx.com.test.data.business.ModuleBsnsImpl" id="ModuleBsnsImpl"> <property name="moduleDAO" ref="ModuleDAO"/> </bean> </beans>
hibernate.hbm
<?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 entity-name="ModulePO" name="mx.com.test.data.pojo.ModulePO" table="MODULE"> <id column="ID_MODULE" name="idModule" type="Long"/> <property column="MODULE_NAME" generated="never" lazy="false" name="name" type="string"/> <property column="DESCRIPTION" generated="never" lazy="false" name="description" type="string"/> <property column="START_DATE" generated="never" lazy="false" name="validityStartCalendar" type="calendar"/> <property column="END_DATE" generated="never" lazy="false" name="validityEndCalendar" type="calendar"/> <property column="VIDEO" generated="never" lazy="false" name="video" type="string"/> <property column="STATUS" generated="never" lazy="false" name="status" type="boolean"/> <property column="IMAGE" generated="never" lazy="false" name="image" type="string"/> <property column="USER_NAME" generated="never" lazy="false" name="description" type="string"/> </class> </hibernate-mapping>
hibernate.reveng <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering> <table catalog="TestDB" name="USER_MODULE"> <primary-key> <key-column name="ID_MODULE"></key-column> <key-column name="NO_REGISTRY"></key-column> </primary-key> <column name="ID_MODULE"></column> <column name="NO_REGISTRY"></column> <column name="ID_MODULE"></column> <column name="NO_REGISTRY"></column> <column name="FINISHED"></column> <column name="CURRENT_MODULE"></column> <column name="CURRENT_QUESTION"></column> <column name="SEEN_VIDEO"></column> <column name="FINISH_DATE"></column> </table> </hibernate-reverse-engineering>
Through dependency injection my application goes straight to the DAO object from the servlet so i have no issues in that part
Thanks a lot I will appreciate a lot your help
|