|
|
|
Hello,
I recently find out that the hibernate Hibernate is unable to create a table in database for entity described below: {code} @Entity public class Test {
private int id;
private int limit;
@Id @GeneratedValue public int getId() { return id; }
public void setId(int id) { this.id = id; }
public int getLimit() { return limit; }
public void setLimit(int limit) { this.limit = limit; } } {code} The problem is with field the name "limit". When I change it to "limitation" (getter and setter changed accordingly) the table was created perfectly.
My maven configuration: {code} <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>4.3.5.Final</version> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.3-1101-jdbc41</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-jpamodelgen</artifactId> <version>1.3.0.Final</version> </dependency>
Hibernate is configured via Spring: <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="packagesToScan" value="pl.comit.radpoint.model.jpa" /> <property name="persistenceProvider"> <bean class="org.hibernate.ejb.HibernatePersistence" /> </property> <property name="jpaProperties"> <props> <prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop> <prop key="hibernate.connection.url">jdbc:postgresql://localhost:5432/...</prop> <prop key="hibernate.connection.username">...</prop> <prop key="hibernate.connection.password">...</prop> <prop key="hibernate.hbm2ddl.auto">create</prop> </props> </property> </bean>
If you need any further information let me know. My email address: arkadiusz.firus@gmail.com
|
|
|
|