Liquibase generating changelog - jhipster

I've been googling for hours but it doesn't seems to exist another way to create liquibase changelog files but by hand.
Isn't there any tools or command lines to automate the creation of changelog files ? I'm using JHipster that is correctly creating changelogs for new entities but as stated here, JHipster won't generate new changelogs for updated entites, so I was wondering if their was any kind of tool to generate additional changelogs? Actually I'm creating changelogs by writing xml files by hand and it doesn't seems super efficient.
Thank you for reading.

You can try to generate a changelog from your JPA entities and then add them to your changelog selectively as described here where you can find an example on how to generate changelogs from jpa entities.
Another technique could be to generate your jpa entities automatically in your database using spring.jpa.hibernate.ddl-auto=update and then generate your liquibase changelog to export the current database state and then add selectively new entities to your applicaton changelog.
You can also generate liquibase changelog using a database with tables previously created.
liquibase --driver=driver.jdbc.Class \
--classpath=/path/to/drivers/lib/driver.jdbc.jar \
--changeLogFile=liquibase-changelog.xml \
--url="jdbc:url:thin:#192.168.1.100:1525:path" \
--username=USER \
--password=PASS \
--logLevel=debug \
generateChangeLog

Related

DiscussionComment entity has Oracle reserved word as a column causing database generation error

When I try to use the stereotype DISCUSSION with Oracle I get an error because of the entity DiscussionComment column named "comment". Although I'm using the correct dialect for my Oracle version, Hibernate is not quoting DDL as needed. This is a very common problem with simple solution. I just want to apply the solution to OpenXava.
I tried to change the DiscussionComment source in OpenXava project (the one that comes with the OpenXava IDE). I changed the column name but it had no effect.
What and where should I change to alter the mapping of the entity?
The same problem applies to "YourFirstEntity", the demo entity of every project because of the "date" column.
Add the property hibernate.globally_quoted_identifiers to true in your persistence unit in persistence.xml
To modify OpenXava Java code, XML or i18n files:
Modify the code on OpenXava/src, OpenXava/xava or OpenXava/i18n.
Execute the Ant target buildOpenXava from
OpenXava/build.xml. It compiles the OpenXava Java code and creates
openxava.jar.
Refresh OpenXava project in Eclipse (F5).
Execute the Ant target updateOX from the build.xml of your own project.
Refresh your own project in Eclipse (F5).
reference:
https://openxava.org/OpenXavaDoc/docs/modify-openxava-code_en.html
Credits to #javierpaniza

Unable to run multiple Jbehave stories using the metafilter with multiple meta tags using this maven command

I am unable to run multiple Jbehave stories using the metafilter with multiple meta tags using this maven command - problem with the meta filter specification format that I'm using.
But I can able to run with only one meta filter, but not able to run with many using this below format
clean verify -DJIRAPROJECT=MCODEEW -DJIRA_LABEL=N_OSG -DENVIRONMENT=UAT -Dmetafilter=groovy:MNEW_123&&groovy:MNEW_789 -f pom.xml
groovy: prefix should be specified only once (at the beginning):
... -Dmetafilter=groovy:MNEW_123&&MNEW_789 ...
More details on JBehave meta filters can be found in the official documentation.

JHipster Entity sub generator - updating - master.xml duplicate entries

I am having issues using the "entity" sub generator when attempting update an existing entity.
After running:
jhipster entity <existingEntity>
..and answering the subsequent questions e.g. "Yes, add more fields and relationships", I am asked if I want to overwrite files (which I do), however one of those is master.xml. It adds 2 new entries:
include
file="classpath:config/liquibase/changelog/20170604231923_added_entity_Car.xml"
relativeToChangelogFile="false"/>
And
include
file="classpath:config/liquibase/changelog/20170604231923_added_entity_constraints_Car.xml"
relativeToChangelogFile="false"/>
This is in addition to:
include
file="config/liquibase/changelog/20170604231923_added_entity_Car.xml" relativeToChangelogFile="false"/>
And
include
file="config/liquibase/changelog/20170604231923_added_entity_constraints_Car.xml"
relativeToChangelogFile="false"/>
... which already existed (from JDL import).
They both refer to the same files. Except the new entries include classpath. Anyway, the end result when selecting overwrite and doing a mvn clean install are errors about the entity and constraints already existing (as you would expect). Am I missing a trick here? Should I be not allowing the overwrite in this case? (I had assumed this would just work).
JHipster version is 4.6.2 (I recently updated it) and I've not used the sub generator before as originally did an import from JDL studio.
Thanks in advance for any help you can give.
This has been resolved now.
I had a mismatch between the version the project was upgraded to (v4.6.2) and the global JHipster Generator (v4.6.1).
Updating the JHipster Generator version to v4.6.2 resolved the issues.

How to generate a file consisting of all scenarios tagged by #manual?

I have a bunch of feature files. Some of scenarios and features are tagged with #manual. I'd want to generate a file that will contain all scenarios and features tagged with this tag so that it will be easier to find them out. Obviously I can write parser of feature files myself. But is there existing library or built in way that will do it?
I don't know of any existing library to do it, but I would probably run
cucumber --tags #manual > manual.feature
Then open up "manual.feature" and remove the extra content!

Using JIBx to generate XSD from binding.xml

Is there a way to generate an XSD document automatically from the binding.xml used by JIBx? This is mainly to allow offline validation of the XML documents will be unmarshalled eventually.
I checked the JIBx homepage, it mentioned a tool called Schema Generator:
http://jibx.sourceforge.net/jibxtools/schema-example.html
but looks like the jibx-genschema.jar file is no longer part of the package anymore, as such I was wondering if there is any alternative
Thanks!
Here is the link to the original package.
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/codehaus/xfire/jibx/genschema/jibx-genschema.jar
Schema generator main class is org.jibx.binding.Compile. It is available in jibx-bind.jar.
This jar can be added to your project with maven dependency org.jibx:jibx-bind:1.2.3 (for example).
The SchemaGen tool has been included in the jibx-tools.jar file for some time. See the JiBX Binding Generator page for instructions on running tools in the jar, just substitute the target class org.jibx.schema.generator.SchemaGen to run the schema generator.

Resources