This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface PageRepository extends CrudRepository<Page, Long> { | |
} | |
public interface PortalRepository extends CrudRepository<Portal, Long> { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.datasource.jndi-name=java:jboss/datasources/MySQLDataSource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.jpa.hibernate.ddl-auto=none | |
spring.datasource.url=jdbc:mysql://localhost/test | |
spring.datasource.username= | |
spring.datasource.password= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@Profile("default") | |
public class DatabaseLoader { | |
private final PageRepository pageRepository; | |
private final PortalRepository portalRepository; | |
@Autowired | |
public DatabaseLoader(PageRepository pageRepository, PortalRepository portalRepository) { | |
this.pageRepository = pageRepository; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ComponentScan | |
@EnableAutoConfiguration | |
public class Application extends SpringBootServletInitializer { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
@Override | |
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(SpringJUnit4ClassRunner.class) | |
@SpringApplicationConfiguration(classes = Application.class) | |
@WebAppConfiguration | |
@IntegrationTest("server.port:0") | |
public class PageControllerTest { | |
@Autowired | |
PageRepository pageRepository; | |
@Value("${local.server.port}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<subsystem xmlns="urn:jboss:domain:datasources:2.0"> | |
<datasources> | |
<datasource jndi-name="java:jboss/datasources/MySQLDataSource" pool-name="MySQLDataSourcePool" enabled="true" use-java-context="true"> | |
<connection-url>jdbc:mysql://localhost/test</connection-url> | |
<driver>mysql</driver> | |
</datasource> | |
<drivers> | |
<driver name="mysql" module="com.mysql"> | |
<datasource-class>com.mysql.jdbc.Driver</datasource-class> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<module xmlns="urn:jboss:module:1.3" name="com.mysql"> | |
<resources> | |
<resource-root path="mysql-connector-java-5.1.32.jar"/> | |
</resources> | |
<dependencies> | |
<module name="javax.api"/> | |
<module name="javax.transaction.api"/> | |
</dependencies> | |
</module> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPRING_PROFILES_ACTIVE=jboss ./standalone.sh -c standalone-backbase.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-data-jpa</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-data-rest</artifactId> | |
</dependency> |