I am working on a spring + hibernate based project. Actually, A project is given to me with Simple Spring Web Maven Structure (Spring Tool Suit as IDE).
I have successfully imported the project into my STS IDE and have also changed some of hibernate configuration properties so that application will be able to talk to my local PostGreSQL server.
The changes that I have made are as given below:
jdbc.driverClassName=org.postgresql.Driver jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect jdbc.databaseurl=jdbc:postgresql://localhost:5432/schema jdbc.username=username jdbc.password=password The hibernate.hbm2ddl.auto property is already set to update so I didn't change that.
Then I simply deploy my project to Pivotal Server and hibernate get executed and creates around 36 tables inside my DB schema. Looks fine !
My Problem: In my hibernate.cfg.XML file total 100 Java model classes are mapped and they also have @Entity annotation. Then, why hibernate is not creating all the remaining tables?
Due to some cause I can't post the code of any of the model class here, I have searched a lot about the problem and applied many different solutions but didn't worked. Could someone please let me know that what could be the reasons that hibernate can react like this?
One of my model class which is not created in my DB.
@Entity @Table(name = "fare_master") public class FareMaster { @Id @Column(name = "fare_id") @GeneratedValue private int fareId; @Column(name = "base_fare_amount") private double baseFareAmount; public int getFareId() { return fareId; } public void setFareId(int fareId) { this.fareId = fareId; } public double getBaseFareAmount() { return baseFareAmount; } public void setBaseFareAmount(double baseFareAmount) { this.baseFareAmount = baseFareAmount; } } And mapping of the class is as follows
<mapping class="com.mypackage.model.FareMaster" />