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
| <bean id="derbyServerIP" class="java.net.InetAddress" | |
| factory-method="getByName"> | |
| <argument value="localhost"></argument> | |
| </bean> | |
| <bean id="derbyServer" class="org.apache.derby.drda.NetworkServerControl" | |
| destroy-method="shutdown"> | |
| <argument ref="derbyServerIP" /> | |
| <argument value="$[database.port]" /> | |
| </bean> | |
| <bean id="pw" class="java.io.PrintWriter"> |
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 ref="dataSource" interface="javax.sql.DataSource"> | |
| <service-properties> | |
| <entry key="osgi.jndi.service.name" value="jdbc/${project.parent.artifactId}.database" /> | |
| </service-properties> | |
| </service> |
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 ref="dataSource" interface="javax.sql.XADataSource"> | |
| <service-properties> | |
| <entry key="osgi.jndi.service.name" value="jdbc/${project.parent.artifactId}.database.xa" /> | |
| </service-properties> | |
| </service> |
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
| @Data | |
| // equals, hashcode, getters and setters | |
| @Builder | |
| // builder pattern | |
| @NoArgsConstructor | |
| // constructor | |
| @AllArgsConstructor | |
| // other constructor | |
| @Entity | |
| // persistence class declaration |
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
| /** | |
| * JPA accessible interface by business or route module | |
| * (see business module for JMS or REST export, don't forget the | |
| * osgi.bnd cxf package export). | |
| * @author charliemordant | |
| */ | |
| public interface HelloRepository extends JpaRepository<HelloEntity, 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
| @OsgiServiceProvider(classes = { HelloRepository.class }) | |
| @Singleton | |
| @Transactional | |
| public class HelloJpaRepository extends DelegatingSimpleJpaRepository<HelloEntity, Long> implements HelloRepository { | |
| /** | |
| * Entity manager. | |
| */ | |
| @PersistenceContext(unitName = "myTestPu") | |
| private EntityManager em; |
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
| <bean id="helloObjectRepository" class="net.osgiliath.hello.model.jpa.repository.impl.HelloObjectJpaRepository"> | |
| <argument value="${project.artifactId}.model.HelloEntity"></argument> | |
| <jpa:context unitname="${project.artifactId}Pu"></jpa:context> | |
| <tx:transaction method="*" value="Required" /> | |
| </bean> |
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 ref="helloObjectRepository" interface="net.osgiliath.hello.model.jpa.repository.HelloObjectRepository" /> |
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
| @Slf4j | |
| @ApplicationScoped | |
| @ContextName | |
| public class HelloServiceJMS extends RouteBuilder implements HelloService { | |
| private final transient DataFormat helloObjectJSonFormat = new JacksonDataFormat( | |
| HelloEntity.class, Hellos.class); | |
| /** | |
| * The repository. | |
| */ | |
| @Inject |