add this plugin dep to your pom:
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>1.0.0.redhat-355</version>
add this plugin dep to your pom:
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>1.0.0.redhat-355</version>
package br.net.rafaeltuelho.servlets; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.UnsupportedEncodingException; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.net.URLEncoder; |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
JBoss, Home of Professional Open Source | |
Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual | |
contributors by the @authors tag. See the copyright.txt in the | |
distribution for a full listing of individual contributors. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>br.net.rafaeltuelho</groupId> | |
<artifactId>unit1</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<description>JB297 Training</description> | |
<developers> | |
<developer> |
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="2.1" 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"> | |
<persistence-unit name="unit1" transaction-type="JTA"> | |
<provider>org.hibernate.ejb.HibernatePersistence</provider> | |
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source> | |
<properties> | |
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> | |
<property name="hibernate.hbm2ddl.auto" value="create-drop"/> | |
<property name="hibernate.show_sql" value="true"/> | |
<property name="hibernate.format_sql" value="true"/> |
@Deployment | |
public static Archive<?> createDeployment() { | |
// You can use war packaging... | |
@SuppressWarnings("unused") | |
WebArchive war = ShrinkWrap | |
.create(WebArchive.class, "test.war") | |
.addPackage(Bus.class.getPackage()) | |
// .addAsManifestResource( | |
// new File("src/main/resources/META-INF", | |
// "persistence.xml")) |
public void findindAllUsingJpqlQuery() throws Exception { | |
// given | |
String fetchingAllInJpql = "select e from " + ENTITY_NAME | |
+ " e order by e.id"; | |
// when | |
System.out.println("Selecting (using JPQL)..."); | |
List<Entity> entities = em.createQuery(fetchingAllInJpql, | |
Entity.class).getResultList(); |
// in JavaSE environment | |
EntityManagerFactory emf = Persistence.createEntityManagerFactory("sample"); | |
EntityManager em = emf.createEntityManager(); | |
try{ | |
... | |
] | |
finally{ | |
em.close(); |
*.class | |
# Mobile Tools for Java (J2ME) | |
.mtj.tmp/ | |
# Package Files # | |
*.jar | |
*.war | |
*.ear |
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.redhat.workshop.fuse</groupId> | |
<artifactId>camel-java</artifactId> | |
<packaging>bundle</packaging> | |
<version>1.0.0-SNAPSHOT</version> |