14 min read

The web application structure is divided into three options:

  1. Java src directory
  2. Resources directory
  3. Web app directory

We can continue with resources directory.

ValidationMessages.properties

# Standard constraints (for JSF converter/validator messages, see ApplicationBundle.properties) -----------------------

javax.validation.constraints.NotNull.message = Please fill out this field.

# Custom constraints (for JSF converter/validator messages, see ApplicationBundle.properties) -------------------------

invalid.email = Please enter a valid email address.
invalid.password = The password must be at least 8 characters long and have at least 1 non-alphabetic character. 

ValidationMessages_de.properties

# Standard constraints (for JSF converter/validator messages, see ApplicationBundle.properties) -----------------------

javax.validation.constraints.NotNull.message = Füllen Sie das aus.


# Custom constraints (for JSF converter/validator messages, see ApplicationBundle.properties) -------------------------

invalid.email = Füllen Sie eine gültige E-Mail aus.
invalid.password = Passwort muss mindestens 8 Zeichen lang sein und mindestens 1 nicht-alphabetisches Zeichen haben.

ValidationMessages_nl.properties

# Standard constraints (for JSF converter/validator messages, see ApplicationBundle.properties) -----------------------

javax.validation.constraints.NotNull.message = Vul dit in.


# Custom constraints (for JSF converter/validator messages, see ApplicationBundle.properties) -------------------------

invalid.email = Vul een geldig email in.
invalid.password = Wachtwoord moet minimaal 8 karakters lang zijn en minimaal 1 niet-alfabetisch karakter hebben.

These three files are only for localization in order to have three languages: English, German, and Dutch. We can add additional European or world-wide languages with different encoding via saving the files such as Chinese, Japanese, Greek, Italian, Spanish, etc.

There is also a directory i18n that is called internationalization as follows.

This is the default one as shown below:

ApplicationBundle.properties

#######################################################################################################################
# RULES                                                                                                               #
# -----                                                                                                               #
#                                                                                                                     #
# Only and only fields/labels/buttons as in outputLabel value, commandLink value, commandButton value, table header,  #
# etc, MAY be keyed in "general" group. Page titles, paragraphs, messages, errors, etc MAY NOT be put in there!       #
#                                                                                                                     #
# Enums MUST have their own classname and fieldname as key (example: EnumClassName.ENUM_VALUE).                       #
#                                                                                                                     #
# XHTML files and their associated backing beans MUST have their own unique prefix which is based on page path.       #
# Given an example of /folder/page, keys MUST be constructed like follows, with underscore instead of slash:          #
#                                                                                                                     #
# - folder_page.title = Ends up in <title> (except for home.title) and in <h1>.                                       #
# - folder_page.header.foo = Ends up in <h2> of section or header of dialog which tells about "foo".                  #
# - folder_page.paragraph.foo = Ends up in <p> which tells about "foo".                                               #
# - folder_page.list.foo.item1 = Ends up in first <li> of <ul> or <ol> which tells about "foo".                       #
# - folder_page.input.foo.label = Ends up in <label for="foo">.                                                       #
# - folder_page.input.foo.tooltip = Ends up in <label for="foo" title>.                                               #
# - folder_page.input.foo.placeholder = Ends up in <input id="foo" placeholder>.                                      #
# - folder_page.button.foo.label = Ends up in <button id="foo" value>.                                                #
# - folder_page.button.foo.tooltip = Ends up in <button id="foo" title>.                                              #
# - folder_page.message.info.fooed = Ends up in INFO faces message about something which is foo'ed.                   #
# - folder_page.message.warn.fooed = Ends up in WARN faces message about something which is foo'ed.                   #
# - folder_page.message.error.fooed = Ends up in ERROR faces message about something which is foo'ed.                 #
#                                                                                                                     #
# NOTES                                                                                                               #
# - xxx.paragraph, xxx.tooltip and xxx.message values MUST end with a period.                                         #
# - quoted values MUST use u2018+u2019 quotes.                                                                        #
# - apostrophes as in don't, haven't, we'll, you're, MUST use u2019.                                                  #
# - page-specific keys MAY NOT be used in other pages/beans! First look if you don't actually need to refactor        #
#   the duplication (e.g. common include file). If that is really not possible, and it does not fit in "general"      #
#   group, then just create a new key, even if it has the same value.                                                 #
#                                                                                                                     #
# When in doubt, look carefully at existing keys below or consult a colleague.                                        #
#                                                                                                                     #
#######################################################################################################################


# this ----------------------------------------------------------------------------------------------------------------

this.name = Java EE kickoff app
this.owner = Java EE kickoff team
this.language.name = English
this.language.code = en


# general -------------------------------------------------------------------------------------------------------------

general.actions = Actions
general.cancel = Cancel
general.change = Change
general.company = Company
general.confirmPassword = Confirm Password
general.created = Created
general.currentPassword = Current Password
general.edit = Edit
general.email = Email
general.emailVerified = Verified?
general.forgotPassword = Forgot Password?
general.firstName = First Name
general.fullName = Full Name
general.groups = Groups
general.home = Home
general.id = ID
general.lastModified = Last Modified
general.lastName = Last Name
general.legal = Legal
general.login = Log In
general.logout = Logout
general.newPassword = New Password
general.password = Password
general.rememberMe = Remember Me
general.remove = Remove
general.reset = Reset
general.save = Save
general.signup = Sign Up
general.social = Social
general.unloadmessage = You have unsaved data. Are you sure to leave the page?


# enums ---------------------------------------------------------------------------------------------------------------

Group.ADMINISTRATORS = Administrators
Group.USERS = Users


# general pages -------------------------------------------------------------------------------------------------------

home.title = Welcome
about.title = About
help.title = Help
contact.title = Contact
terms_of_service.title = Terms of Service
privacy_policy.title = Privacy Policy
cookie_policy.title = Cookie Policy


# auth pages ----------------------------------------------------------------------------------------------------------

login.title = Log In
login.paragraph.signup = Don\u2019t have an account? {0}!

signup.title = Sign Up
signup.paragraph.login = Already have an account? {0}!

reset_password.title = Reset Password
reset_password.message.info.email_sent = An email has been sent to specified address containing the instructions on how to reset your password. If you have not received the email after a few minutes, please check your spam box. If you have still not received any email, contact us.
reset_password.message.info.password_changed = Password has been changed successfully, you can now log in.
reset_password.message.warn.invalid_token = The token is invalid or has expired.

auth.message.error.failure = Authentication failed. Perhaps you forgot password or you want to sign up?
auth.message.warn.logged_out = You have been logged out.
auth.message.warn.already_logged_in = You are already logged in!


# user pages ----------------------------------------------------------------------------------------------------------

user_profile.title = Your Profile
user_profile.header.account = Account
user_profile.header.change_password = Change Password
user_profile.message.info.account_updated = Your account has been updated!
user_profile.message.info.password_changed = Your password has been changed!

admin_users.title = Users
admin_users_edit.title = Edit User


# errorpages ----------------------------------------------------------------------------------------------------------

errorpages_500.title = Oops!
errorpages_500.paragraph.1 = Unfortunately, an unexpected problem has occurred during processing of your request. This is not your fault, <strong>this is our fault</strong>. We have been notified about this and we will try to investigate and fix it.
errorpages_500.paragraph.2 = Please retry and if the problem persists, please contact us and tell about the steps you did in order to cause this.

errorpages_400.title = 400 - Bad Request
errorpages_400.paragraph.1 = Oops, we did not understood this request. Likely some parameters are wrong or missing.
errorpages_400.paragraph.2 = Please retry with the right parameters, or start at {0} to find all available resources.

errorpages_404.title = 404 - Page Not Found
errorpages_404.paragraph.1 = Oops, we could not find the requested resource as specified in your browser\u2019s address bar.
errorpages_404.paragraph.2 = Please retry with the right URL, or start at {0} to find all available resources.

errorpages_expired.title = Session expired
errorpages_expired.paragraph.1 = Oops, your session has expired. This may happen after {0} minutes of inactivity, or when you have logged out in another browser tab/window.
errorpages_expired.paragraph.2 = Please reload the page, or restart at {0} page.


# JSF converters/validators (for Bean Validation messages, see ValidationMessages.properties) -------------------------

javax.faces.component.UIInput.REQUIRED = Please fill out this field.


# Custom converters/validators (for Bean Validation messages, see ValidationMessages.properties) ----------------------

localDateConverter = That doesn\u2019t look like a valid date. Please try again.
emailVerifiedValidator = Your email has not been verified yet.
duplicateEmailValidator = This email is already registered. Perhaps you want to log in?
confirmPasswordValidator = Passwords were not the same. Please try again.


# Custom tags ---------------------------------------------------------------------------------------------------------

tags.input.checkbox.requiredMessage = Please tick the checkbox.
tags.table.search.placeholder = Search\u2026
tags.table.currentPageReportTemplate = Showing {startRecord} - {endRecord} of {totalRecords}
tags.table.paginatorTemplate = Show rows: {RowsPerPageDropdown} {CurrentPageReport} {PreviousPageLink} {NextPageLink}

The default locale is English, then we have the same file as before as shown below:

ApplicationBundle_en.properties

The two remaining languages German and Dutch are the following:

ApplicationBundle_de.properties

# this ----------------------------------------------------------------------------------------------------------------

this.name = Kickoff Vorbild
this.language.name = Deutsch
this.language.code = de


# general -------------------------------------------------------------------------------------------------------------

general.actions = Handlungen
general.cancel = Abbrechen
general.change = Ändern
general.company = Unternehmung
general.confirmPassword = Passwort bestätigen
general.created = Erstellt
general.currentPassword = Aktuelles Passwort
general.edit = Beartbeiten
general.email = E-Mail
general.emailVerified = Verifiziert?
general.forgotPassword = Passwort vergessen?
general.firstName = Vorname
general.fullName = Vollständiger Name
general.groups = Gruppen
general.home = Hauptseite
general.id = ID
general.lastName = Nachname
general.legal = Rechtlich
general.login = Einloggen
general.logout = Ausloggen
general.newPassword = Neues Passwort
general.password = Passwort
general.rememberMe = Erinnere mich an diesem Computer
general.remove = Entfernen
general.reset = Zurücksetzen
general.save = Speichern
general.signup = Anmelden
general.social = Social
general.unloadmessage = Es gibt nicht gespeicherte Daten. Möchten Sie diese Seite wirklich verlassen?


# enums ---------------------------------------------------------------------------------------------------------------

Group.ADMINISTRATORS = Administratoren
Group.USERS = Benutzer


# general pages -------------------------------------------------------------------------------------------------------

home.title = Willkommen
about.title = Wir
help.title = Hilfe
contact.title = Kontakt
terms_of_service.title = Nutzungsbedingungen
privacy_policy.title = Datenschutzerklärung
cookie_policy.title = Cookie-Richtlinien


# auth pages ----------------------------------------------------------------------------------------------------------

login.title = Einloggen
login.paragraph.signup = Noch kein Benutzer? {0}!

signup.title = Anmelden
signup.paragraph.login = Bereits ein Benutzer? {0}!

reset_password.title = Passwort zurücksetzen

auth.message.error.failure = Authentifizierung fehlgeschlagen. Sie haben vielleicht Ihr Passwort vergessen oder möchten Sie sich anmelden?
auth.message.warn.logged_out = Sie sind ausgeloggt.
auth.message.warn.already_logged_in = Sie sind bereits eingeloggt!


# user pages ----------------------------------------------------------------------------------------------------------

user_profile.title = Dein Profil
user_profile.header.account = Konto
user_profile.header.change_password = Passwort ändern
user_profile.message.info.account_updated = Ihr Konto wurde aktualisiert!
user_profile.message.info.password_changed = Ihr Passwort wurde geändert!

admin_users.title = Benutzer
admin_users_edit.title = Benutzer ändern


# JSF validators (for Bean Validation messages, see ValidationMessages.properties) ------------------------------------

javax.faces.component.UIInput.REQUIRED = Füllen Sie das aus.


# Custom converters/validators (for Bean Validation messages, see ValidationMessages.properties) ----------------------

localDateConverter = Das war kein gültiges Datum. Bitte versuchen Sie es erneut.
emailVerifiedValidator = Ihre E-Mail wurde noch nicht verifiert.
duplicateEmailValidator = Diese E-Mail ist bereits im Einsatz. Vielleicht möchten Sie sich einloggen?
confirmPasswordValidator = Passwörter waren nicht gleich. Bitte versuchen Sie es erneut.


# Custom tags ---------------------------------------------------------------------------------------------------------

tags.input.checkbox.requiredMessage = Überprüfen Sie dies heraus.
tags.table.search.placeholder = Suche\u2026
tags.table.currentPageReportTemplate = Zeige {startRecord} - {endRecord} von {totalRecords}
tags.table.paginatorTemplate = {RowsPerPageDropdown} {CurrentPageReport} {PreviousPageLink} {NextPageLink}

ApplicationBundle_nl.properties

# this ----------------------------------------------------------------------------------------------------------------

this.name = Kickoff Voorbeeld
this.language.name = Nederlands
this.language.code = nl


# general -------------------------------------------------------------------------------------------------------------

general.actions = Acties
general.cancel = Annuleren
general.change = Verander
general.company = Bedrijf
general.confirmPassword = Herhaal wachtwoord
general.created = Aangemaakt
general.currentPassword = Huidig wachtwoord
general.edit = Wijzigen
general.email = Email
general.emailVerified = Geverifieerd?
general.forgotPassword = Wachtwoord vergeten?
general.firstName = Voornaam
general.fullName = Volledige naam
general.groups = Groepen
general.home = Hoofdpagina
general.id = ID
general.lastName = Achternaam
general.legal = Rechtelijk
general.login = Inloggen
general.logout = Uitloggen
general.newPassword = Nieuw wachtwoord
general.password = Wachtwoord
general.rememberMe = Onthoud mij op deze computer
general.remove = Verwijderen
general.reset = Herstellen
general.save = Opslaan
general.signup = Inschrijven
general.social = Social
general.unloadmessage = Er is niet-opgeslagen data. Wil je de pagina zeker verlaten?


# enums ---------------------------------------------------------------------------------------------------------------

Group.ADMINISTRATORS = Beheerders
Group.USERS = Gebruikers


# general pages -------------------------------------------------------------------------------------------------------

home.title = Welkom
about.title = Wij
help.title = Help
contact.title = Contact
terms_of_service.title = Servicevoorwaarden
privacy_policy.title = Privacybeleid
cookie_policy.title = Cookiebeleid


# auth pages ----------------------------------------------------------------------------------------------------------

login.title = Inloggen
login.paragraph.signup = Nog geen gebruiker? {0}!

signup.title = Inschrijven
signup.paragraph.login = Al een gebruiker? {0}!

reset_password.title = Wachtwoord herstellen

auth.message.error.failure = Authenticatie niet gelukt. Wellicht ben je je wachtwoord vergeten, of wil je je inschrijven?
auth.message.warn.logged_out = Je bent uitgelogd.
auth.message.warn.already_logged_in = Je bent al ingelogd!


# user pages ----------------------------------------------------------------------------------------------------------

user_profile.title = Jouw profiel
user_profile.header.account = Account
user_profile.header.change_password = Verander wachtwoord
user_profile.message.info.account_updated = Jouw account is bijgewerkt!
user_profile.message.info.password_changed = Jouw wachtwoord is veranderd!

admin_users.title = Gebruikers
admin_users_edit.title = Wijzig gebruiker


# JSF validators (for Bean Validation messages, see ValidationMessages.properties) ------------------------------------

javax.faces.component.UIInput.REQUIRED = Vul dit in.


# Custom converters/validators (for Bean Validation messages, see ValidationMessages.properties) ----------------------

localDateConverter = Dat leek niet op een geldige datum. Probeer het nogmaals.
emailVerifiedValidator = Jouw email is nog niet geverifieerd.
duplicateEmailValidator = Dit email is al in gebruik. Wellicht wil je je inloggen?
confirmPasswordValidator = Wachtwoorden waren niet hetzelfde. Probeer het nogmaals.


# Custom tags ---------------------------------------------------------------------------------------------------------

tags.input.checkbox.requiredMessage = Vink dit aan.
tags.table.search.placeholder = Zoek\u2026
tags.table.currentPageReportTemplate = Toont {startRecord} - {endRecord} van {totalRecords}
tags.table.paginatorTemplate = {RowsPerPageDropdown} {CurrentPageReport} {PreviousPageLink} {NextPageLink}

META-INF/conf/dev/application-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Settings for the application that are specific to the DEV stage. 
		Note that these are merged with conf/application-settings.xml.
		Settings specified here will override those.
	</comment>

	<!-- Application -->
	<entry key="stageName">dev</entry>
	<entry key="applicationURLScheme">http</entry>
	<entry key="applicationSubDomain">dev</entry>
	<entry key="applicationDomain">kickoff.example.org</entry>
</properties>

META-INF/conf/dev/datasource-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Settings for the main data source that are specific to the DEV stage. 
		Note that these are merged with conf/datasource-settings.xml.
		Settings specified here will override those.
	</comment>
	
	<entry key="password">devExamplePassword</entry>
</properties>

META-INF/conf/local-dev/application-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Settings for the application that are specific to the LOCAL DEV stage. 
		Note that these are merged with conf/application-settings.xml.
		Settings specified here will override those.
	</comment>

	<!-- Application -->
	<entry key="stageName">local-dev</entry>
	<entry key="applicationURLScheme">http</entry>
	<entry key="applicationDomain">localhost</entry>
	<entry key="applicationPortNumber">8080</entry>
	
	<!-- Mail -->
	<entry key="mandrillRequestResponseLogging">true</entry>
</properties>

META-INF/conf/live/application-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Settings for the application that are specific to the LIVE stage. 
		Note that these are merged with conf/application-settings.xml.
		Settings specified here will override those.
	</comment>

	<!-- Application -->
	<entry key="stageName">live</entry>
	<entry key="developmentMode">false</entry>
	<entry key="applicationURLScheme">https</entry>
	<entry key="applicationDomain">kickoff.example.org</entry>
</properties>

META-INF/conf/live/datasource-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Settings for the main data source that are specific to the LIVE stage. 
		Note that these are merged with conf/datasource-settings.xml.
		Settings specified here will override those.
	</comment>
	
	<entry key="password">liveExamplePassword</entry>
</properties>

META-INF/conf/application-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Base settings for the application that are common for all stages.
	</comment>

	<!-- Application -->
	<entry key="developmentMode">true</entry>

	<!-- Mail -->
	<entry key="fromEmail">Kickoff Example &lt;support@kickoff.example.org&gt;</entry>
	<entry key="supportEmail">support@kickoff.example.org</entry>
	<entry key="adminEmail">admin@kickoff.example.org</entry>
	<entry key="exceptionsEmail">exceptions@kickoff.example.org</entry>

	<!-- STAGING-DEFAULT - should put key here that is set to NOT send mails to recipients. -->
	<!-- Then define separate key for live stage that DOES actually send mails. -->
	<entry key="mandrillAPIKey">???</entry> 
	<entry key="mandrillDefaultTemplateId">???</entry>
</properties>

META-INF/conf/datasource-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Base settings for the main data source that are common for all stages.
		Note that the initial settings can also be specified in /WEB-INF/web.xml.
	</comment>

	<entry key="className">org.h2.jdbcx.JdbcDataSource</entry>
	<entry key="url">jdbc:h2:mem:kickoff;DB_CLOSE_DELAY=-1</entry>
	<entry key="user">sa</entry>
	<entry key="password">sa</entry>
</properties>

META-INF/conf/emails.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>			
		Emails content
	</comment>


	<!-- NOTE: Don't indent CDATA content! -->

	<!-- NOTE: Don't use HTML <br> or <p>, this will be taken care of automatically based on newlines! -->
	<!--       The code will convert 2 successive newlines to <br/><br/> not <p>.                      -->
	<!--       Note that block elements like <blockquote> and <ul> already start at a new "paragraph". -->

	<entry key="default_salutation_content_text"><![CDATA[
Dear {toUser.fullName},
	]]></entry>


	<!-- New user registered ====================================================================================== -->

	<entry key="newUserRegistered_subject_content_text"><![CDATA[
Verify Your Email
	]]></entry>

	<entry key="newUserRegistered_body_content_HTML"><![CDATA[
To complete your sign up please verify your email address by clicking the button below.

<a href="*|CTA1_URL|*">*|CTA1_URL|*</a>
	]]></entry>

	<entry key="newUserRegistered_call_to_action_label_text"><![CDATA[
Verify Your Email
	]]>
	</entry>


	<!-- New User Email Verified =================================================================================== -->

	<entry key="newEmailVerified_subject_content_text"><![CDATA[
New user with a verified email
	]]></entry>

	<entry key="newEmailVerified_body_content_HTML"><![CDATA[
Below user has just completed the signup:

<ul>
<li>User email: {user.email}</li>
<li>User name: {user.fullName}</li>
<li>Referral: {referral}</li>
</ul>
	]]></entry>


	<!-- User request password ===================================================================================== -->

	<entry key="resetPassword_subject_content_text">
	<![CDATA[
Reset Your password
	]]>
	</entry>

	<entry key="resetPassword_body_content_HTML">
	<![CDATA[
We have received a request from IP address {ip} to reset the password of your account.
If you did not request this reset, just ignore this email.
Otherwise, please press the below button to reset your password.
This request is valid until {expiration,dateTime,long}.
	]]>
	</entry>

	<entry key="resetPassword_call_to_action_label_text">
	<![CDATA[
Reset Your password
	]]>
	</entry>

</properties>

src/main/resources/META-INF/LoginToken.xml

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
	xmlns="http://java.sun.com/xml/ns/persistence/orm"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
	version="2.0"
>
	<named-query name="LoginToken.remove">
		<query>
			DELETE
			FROM
				LoginToken _loginToken
			WHERE
				_loginToken.tokenHash = :tokenHash
		</query>
	</named-query>

	<named-query name="LoginToken.removeExpired">
		<query>
			DELETE
			FROM
				LoginToken _loginToken
			WHERE
				_loginToken.expiration &lt; CURRENT_TIMESTAMP
		</query>
	</named-query>
</entity-mappings>

src/main/resources/META-INF/User.xml

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
	xmlns="http://java.sun.com/xml/ns/persistence/orm"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
	version="2.0"
>
	<named-query name="User.getByEmail">
		<query>
			SELECT
				_user
			FROM
				User _user					
			WHERE
				_user.email = :email
		</query>
	</named-query>

	<named-query name="User.getByLoginToken">
		<query>
			SELECT
				_user
			FROM
				User _user
					JOIN
				_user.loginTokens _loginToken
					JOIN FETCH
				_user.loginTokens
			WHERE
				_loginToken.tokenHash = :tokenHash AND
				_loginToken.type = :tokenType AND
				_loginToken.expiration &gt; CURRENT_TIMESTAMP
		</query>
	</named-query>
</entity-mappings>

src/main/resources/META-INF/omni-settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>
		Settings for OmniSettings itself.
	</comment>

    <entry key="stageSystemPropertyName">kickoff.stage</entry>

    <!-- DEFAULT STAGE SHOULD EVENTUALLY BE REMOVED! -->
    <entry key="defaultStage">local-dev</entry>
</properties>

src/main/resources/META-INF/persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence
	xmlns="http://xmlns.jcp.org/xml/ns/persistence"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
	version="2.1"
>
	<persistence-unit name="kickoff">
		<jta-data-source>java:app/kickoff/DataSource</jta-data-source>

		<mapping-file>META-INF/LoginToken.xml</mapping-file>
		<mapping-file>META-INF/User.xml</mapping-file>

		<properties>
			<property name="javax.persistence.schema-generation.database.action" value="drop-and-create" />
			<property name="hibernate.show_sql" value="false" />
			<property name="hibernate.cache.use_second_level_cache" value="true" />
			<property name="hibernate.cache.use_query_cache" value="true" />
			<property name="wildfly.jpa.twophasebootstrap" value="false" /> <!-- https://issues.jboss.org/browse/WFLY-2727 -->
		</properties>
	</persistence-unit>
</persistence>
Orestis Pantazos

Orestis Pantazos

DevOps Engineer