У меня есть следующий класс:
public class Car implements Comparable<Car>{
private long idCar;
private String model;
private String immat; //Car License Plate
private Company company;
private Manufacturer manufacturer;
private Calendar registrationDate;
private Calendar lastControlDate;
//Has empty constructor + Getters and setters here onwards...
и это файл конфигурации Hibernate:
<?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="Car" table="cars" lazy="true">
<id name="idCar" type="long" column="idCar">
<generator class="native" />
</id>
<property name="model" type="string" column="model" />
<property name="immat" type="string" column="immat" />
<property name="registrationDate" type="date" column="registrationDate" />
<property name="lastControlDate" type="date" column="lastControlDate" />
<many-to-one name="company" class="fr.model.company.Company" column="idCompany"
not-null="true" />
<many-to-one name="manufacturer" class="fr.model.component.Manufacturer"
column="idManufacturer" not-null="true" />
</class>
</hibernate-mapping>
и класс производителя:
public class Manufacturer implements Comparable<Manufacturer> {
private Long idManufacturer;
private String name;
Я получаю сообщение об ошибке связи с не сопоставленными ссылками, но пока не могу понять, почему.
Редактировать: Отображение производителя -
<?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="Manufacturer" table="manufacturer">
<id name="idManufacturer" type="long" column="idManufacturer">
<generator class="native" />
</id>
<property name="name" type="string" not-null="true" />
</class>
</hibernate-mapping>
Исключение:
Initial SessionFactory creation failed.org.hibernate.MappingException:
Association references unmapped class: fr.synapture.model.company.Car