Creating table automatically using Hibernate


I tried GenerationType.IDENTITY to my Entity class. it looks ike this

@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique = true, nullable = false)
private int id;

and added

property name=" " as “update”

to hibernate.cfg file. But it didn’t created the Entity to schema automatically.
When i used


it works fine. I am new in hibernate. Any explanation ?


You need to paste the stack trace to see what happens. You say it does not work, but let’s see that in the output.