forge / thorntail-addon

Thorntail Forge Addon
http://thorntail.io/
Eclipse Public License 1.0
14 stars 14 forks source link

Add Datasource within the project-stages.yml file #49

Open cmoulliard opened 7 years ago

cmoulliard commented 7 years ago

When we use Swarm with JPA/Hibernate, the datasource to be used is defined withn the persistence.xml file.

  <persistence-unit name="cdservice-persistence-unit" transaction-type="JTA">
    <description>Forge Persistence Unit</description>
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jboss/datasources/CatalogDS</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="hibernate.format_sql" value="true"/>
      <property name="hibernate.transaction.flush_before_completion" value="true"/>
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
    </properties>
  </persistence-unit>

Unfortunately, no info is added within the project-stages.yml file

swarm:
  datasources:
    data-sources:
      CatalogDS:
        driver-name: mysql
        connection-url: jdbc:mysql://localhost:3306/catalogdb
        user-name: mysql
        password: mysql