I got the source code for my SQL driver and dug a bit deeper with the debugger. The query statement given to the SQL driver is:
Code:
com.mysql.jdbc.ServerPreparedStatement[32] - select normalreso0_.id as id11_, normalreso0_.UserId as UserId11_, normalreso0_.deleted as deleted11_, normalreso0_.path as path11_, normalreso0_.type as type11_, normalreso0_.kbAssetTypeId as kbAssetT6_11_, normalreso0_.subProject as subProject11_ from Resource normalreso0_ where normalreso0_.deleted = 0 and normalreso0_.id=179 and normalreso0_.deleted=0
Is this name mangling normal? What it calls "normalreso0_" is actually "normalResource" in the XML mapping file, and "resource" in the DB table.
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="com.castortech.iris.database.projectrepository.modelobjects.NormalResource" table="Resource" where="deleted = 0">
<id name="id">
<generator class="increment" />
</id>
<property name="UserId"/>
<property name="deleted" />
<property name= "path" />
<property name="type"/>
<property name="kbAssetTypeId" />
<property name="subProjectId" column="subProject"/>
</class>
</hibernate-mapping>
Code:
CREATE TABLE `resource` (
`id` int(8) NOT NULL auto_increment,
`UserId` int(8) default NULL,
`path` varchar(250) default NULL,
`deleted` tinyint(1) default NULL,
`type` int(8) default NULL,
`KBassetTypeId` int(8) default NULL,
`subProject` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=180 ;