Commits

Micha Kops committed 5113db8

Code samples simplified.

Comments (0)

Files changed (4)

 					<name>flyway-tutorial</name>
 					<configFile>src/test/resources/glassfish/domain.xml</configFile>
 				</configuration>
-				<executions>
-					<execution>
-						<id>start-glassfish</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>start</goal>
-						</goals>
-					</execution>
-					<execution>
-						<id>glassfish-deploy</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>deploy</goal>
-						</goals>
-					</execution>
-					<execution>
-						<id>glassfish-undeploy</id>
-						<phase>post-integration-test</phase>
-						<goals>
-							<goal>undeploy</goal>
-						</goals>
-					</execution>
-					<execution>
-						<id>stop-glassfish</id>
-						<phase>post-integration-test</phase>
-						<goals>
-							<goal>stop</goal>
-						</goals>
-					</execution>
-				</executions>
 			</plugin>
 		</plugins>
 	</build>

src/main/java/com/hascode/ejb/BookEJB.java

 	@PersistenceContext(unitName = "hascode-jta-unit")
 	private EntityManager em;
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.hascode.ejb.BookService#findAll()
-	 */
 	@Override
 	public List<Book> findAll() {
 		List<Book> books = em.createQuery("SELECT b FROM Book b", Book.class)

src/main/java/com/hascode/entity/Book.java

 package com.hascode.entity;
 
-import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
-@Entity(name = "Book")
+@Entity
 public class Book {
 	@Id
 	@GeneratedValue
-	@Column(name = "id")
 	private Long id;
 
-	@Column(name = "title", length = 200, nullable = false)
 	private String title;
 
-	@Column(name = "author", length = 200)
 	private String author;
 
 	public final Long getId() {

src/main/java/com/hascode/servlet/BookServlet.java

 			resp.getWriter().append("- " + book.getTitle() + "\n");
 		}
 	}
-
 }