Questions tagged [hbm2ddl]

hibernate utility to manage the creation and/or deployment of database schemas (data definition language)

198 questions
1242
votes
14 answers

What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do

I really want to know more about the update, export and the values that could be given to hibernate.hbm2ddl.auto I need to know when to use the update and when not? And what is the alternative? These are changes that could happen over DB: new…
Suzan
384
votes
15 answers

Hibernate: hbm2ddl.auto=update in production?

Is it okay to run Hibernate applications configured with hbm2ddl.auto=update to update the database schema in a production environment?
cretzel
  • 19,864
  • 19
  • 58
  • 71
68
votes
6 answers

How to turn off hbm2ddl?

I couldn't find a reference on how to switch hbm2ddl off.
Alex
  • 4,033
  • 9
  • 37
  • 52
53
votes
3 answers

Hibernate hbm2ddl.auto, possible values, and what they do

I am looking at the Hibernate hbm2ddl.auto configuration property and its possible values: validate update create create-drop What do all these values do? The Hibernate Reference Documentation only talks briefly about create-drop, but doesn't say…
Danilo Piazzalunga
  • 7,590
  • 5
  • 49
  • 75
46
votes
11 answers

Sequence "HIBERNATE_SEQUENCE" not found; SQL statement

In my spring mvc app, i have the following object. I am trying to make a visual of data using devtool in my app. @Entity @Data public class ConsultationRequest { @Id @GeneratedValue private Long id; private String name; …
Jeff
  • 7,767
  • 28
  • 85
  • 138
35
votes
5 answers

Where did Configuration.generateSchemaCreationScript() go in Hibernate 5

In Hibernate 4.x, I used to generate and export the schema as defined in annotated entities as follows (using Spring to find annotated entities on the class path): Connection connection = …
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
31
votes
6 answers

org.hibernate.MappingException: Unable to find column with logical name

hi my tables are as follows: 1- medical_company: medical_company_id foreign key on account_entity table account_entity_id column (not a pk) column1 column2 column3 2- account_entity: account_entity_id (pk) column1 column2 column3 3-…
Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498
31
votes
1 answer

Hibernate hbm2ddl.auto=update doesn't update column definitions in MySQL

I'm trying to update existing table with hbm2ddl.auto = update. There is several columns in several tables where database column definitions changes from declaration in entities. Like @Column(name="mycolumn", nullable=false, length=10) private Long…
Anatoly
  • 1,551
  • 4
  • 21
  • 40
18
votes
3 answers

How to create database schema in hibernate first time and further update it in case of schema modification?

I want to create database schema in hibernate first time. And further, if there is any modification in the schema, like addition of a new table or deletion of some column, I want to update the existing schema keeping the previous data intact. As per…
M Sach
  • 33,416
  • 76
  • 221
  • 314
18
votes
1 answer

Hibernate - hibernate.hbm2ddl.auto = validate

I am interested in how hibernate.hbm2ddl.auto=validate actually works and I am struggling to find comprehensive documentation. We've recently discovered production system was affected by…
azp74
  • 1,841
  • 2
  • 17
  • 23
15
votes
3 answers

How to make hbm2ddl schemaExport to log schema to stdout?

A quote from persistence.xml:
yegor256
  • 102,010
  • 123
  • 446
  • 597
14
votes
4 answers

Schema export with hibernate annotations

I'm using hibernate annotations and i want to export my database schema. Similar to the schemaexporttask with hbm xml files.
Anthony
  • 1,685
  • 4
  • 22
  • 29
13
votes
3 answers

Unable to generate hbm2ddl using hibernate3-maven-plugin-3.0

I have updated to a newer version of hibernate3-maven-plugin. I get the following error trying to use the plugin mentioned below. Would appreciate any pointers in resolving this issue. org.codehaus.mojo
user899876
13
votes
5 answers

Update database schema with hibernate

update i can create my database schema, it automatically add properties, constraint, key etc... But what about UPDATE the database schema? If i remove some property from my entities, hibernate…
blow
  • 12,811
  • 24
  • 75
  • 112
9
votes
3 answers

Issue with sequence why two entity are sharing the same sequence when generating schema with hbm2ddl ?

I am using hbm2ddl in my hibernate based application to generate the db schema. The value of hibernate.hbm2ddl.auto property is create-drop. I am using @Entity annotations for my POJO classes. @Entity public class testTable1 { @Id …
Ashish K Agarwal
  • 1,172
  • 3
  • 17
  • 33
1
2 3
13 14