Ok, so there is a table in the database called distributionCompanies, created like this:
CREATE TABLE `distributionCompanies` (
`distributionCompanyID` INT(11) NOT NULL,
`distributionCompanyName` VARCHAR(255) NOT NULL,
PRIMARY KEY (distributionCompanyID)
);
I am trying to map this table to a class using Hibernate:
@Entity
@Table(name = "distributionCompanies")
public class DistributionCompany implements DatabaseObject {
@Id
@GeneratedValue
@Column(name = "distributionCompanyID", length = 11, unique = true, nullable = false)
private int distributionCompanyID;
....
However, when I started, I got into this problem:
Initial SessionFactory creation failedorg.hibernate.HibernateException: Missing column: distributionCompanyID_distributionCompanyID in database2.distributionCompanies
This is not the only table in the database, and I was able to map other classes using the same method, so I'm a little puzzled as to why this is causing the problem.
Thanks for your time, Samuel Smith
EDIT: In response to a Xavi comment, I temporarily deleted another collation for the column and the error went away, so the bad egg probably lies in the following code:
@ManyToOne(targetEntity = DistributionCompany.class)
@JoinTable(name = "distributionCompanies", joinColumns = { @JoinColumn(name = "distributionCompanyID", nullable = false) })
private int distributionCompanyID;