Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ';' as default delimiter in Hibernate ORM's generated DDL scripts #17514

Closed
knutwannheden opened this issue May 28, 2021 · 5 comments · Fixed by #17894
Closed

Use ';' as default delimiter in Hibernate ORM's generated DDL scripts #17514

knutwannheden opened this issue May 28, 2021 · 5 comments · Fixed by #17894
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/enhancement New feature or request
Milestone

Comments

@knutwannheden
Copy link
Contributor

Description

The new HibernateOrmConfigPersistenceUnitScriptGeneration allowing to generate DDL scripts is a very nice addition. What appears to be missing is a delimiter option to map to Hibernate's hibernate.hbm2ddl.delimiter option, so that the generated statements in the script are delimited. Otherwise the delimiter is always just a new line, which isn't all that useful, since some statements in the output could span multiple lines.

Implementation ideas

Add a new delimiter option to HibernateOrmConfigPersistenceUnitScriptGeneration. The default value should maybe be ; but another option would be to have a default value for each supported DB kind, although that may just complicate things without much value.

@knutwannheden knutwannheden added the kind/enhancement New feature or request label May 28, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 28, 2021

/cc @Sanne, @gsmet, @yrodiere

@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels May 28, 2021
@Sanne
Copy link
Member

Sanne commented May 28, 2021 via email

@knutwannheden
Copy link
Contributor Author

I really like the idea of having a default value for each database kind.

I assume ; will be OK for most dialects. For Oracle (when using SQL*Plus) \n/ (i.e. a slash on a line of its own) may be a better alternative, although it probably shouldn't matter for the DDL produced by Hibernate, where ; would likely work nicely as well.

If someone knows which separator is required for the currently supported database kinds, it would be great if you could document them here.

@knutwannheden
Copy link
Contributor Author

P.S. I can look into providing a PR for this issue.

knutwannheden added a commit to knutwannheden/quarkus that referenced this issue Jun 1, 2021
This property represents the statement delimiter used for the generation of the DDL scripts. The property defaults to `;`.

Resolves quarkusio#17514
knutwannheden added a commit to knutwannheden/quarkus that referenced this issue Jun 1, 2021
This property represents the statement delimiter used for the generation of the DDL scripts. The property defaults to `;`.

Resolves quarkusio#17514
knutwannheden added a commit to knutwannheden/quarkus that referenced this issue Jun 1, 2021
This property represents the statement delimiter used for the generation of the DDL scripts. The property defaults to `;`.

Resolves quarkusio#17514
knutwannheden added a commit to knutwannheden/quarkus that referenced this issue Jun 3, 2021
This property represents the statement delimiter used for the generation of the DDL scripts. The property defaults to `;`.

Resolves quarkusio#17514
@Sanne Sanne changed the title Extend HibernateOrmConfigPersistenceUnitScriptGeneration with delimiter Use ';' as default delimited in Hibernate ORM's generated DDL scripts Jun 14, 2021
@Sanne
Copy link
Member

Sanne commented Jun 14, 2021

Amending the title to reflect how this is being fixed (via https://hibernate.atlassian.net/browse/HHH-14665 )

@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 14, 2021
@yrodiere yrodiere changed the title Use ';' as default delimited in Hibernate ORM's generated DDL scripts Use ';' as default delimiter in Hibernate ORM's generated DDL scripts Jun 15, 2021
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.Final Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/enhancement New feature or request
Projects
None yet
3 participants