When I run the application, I get the error:
org.hibernate.PropertyNotFoundException: Could not find a getter for delayModule in class com.project.core.hibernate.entities.DBReadFilesEntity
The following settings are in the guavacached.hbm.xml file:
<class name="com.project.core.hibernate.entities.DBReadFilesEntity" table="read_files" catalog="newserver" mutable="false"> <id name="id"> <column name="id" sql-type="int unsigned" not-null="true"/> </id> ... <property name="delayerModulesId"> <column name="delayer_modules_id" sql-type="int unsigned" not-null="true"/> </property> <property name="delayerParams"> <column name="delayer_params" sql-type="varchar" not-null="true"/> </property> ... <many-to-one insert="false" update="false" name="delayerModule" class="com.project.core.hibernate.entities.DBModulesEntity"> <column name="delayer_modules_id" not-null="true"/> </many-to-one> ... </class> And the DBReadFilesEntity class itself :
@Entity @Table(catalog = "newserver", name = "read_files") @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) @org.hibernate.annotations.Entity(mutable = false) public class DBReadFilesEntity { private int id; @Id @Column(name = "id") public int getId() { return id; } public void setId(int id) { this.id = id; } ... private int delayerModulesId; @Basic @Column(name = "delayer_modules_id") public int getDelayerModulesId() { return delayerModulesId; } public void setDelayerModulesId(int delayerModulesId) { this.delayerModulesId = delayerModulesId; } private String delayerParams; @Basic @Column(name = "delayer_params") public String getDelayerParams() { return delayerParams; } public void setDelayerParams(String delayerParams) { this.delayerParams = delayerParams; } ... } And the read_files table schema :
CREATE TABLE `read_files` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, ..., `delayer_modules_id` INT(10) UNSIGNED NOT NULL DEFAULT '4001', `delayer_params` VARCHAR(255) NOT NULL DEFAULT '', ..., PRIMARY KEY (`id`), ..., KEY `FK_read_files_delayer_id` (`delayer__modules_id`), ..., CONSTRAINT `FK_read_files_delayer_id` FOREIGN KEY (`delayer_modules_id`) REFERENCES `modules` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE, ... ) ENGINE=INNODB AUTO_INCREMENT=4 DEFAULT CHARSET=cp1251 What is the mistake?
<many-to-one name="delayerModule" ...apparently many links to one are made incorrectly. - MrFylypenko