Skip to content

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

@cmoulliard

Description

@cmoulliard

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions