You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by gollum <ch...@gmail.com> on 2013/03/03 03:06:52 UTC
Derby database does not get created
Hi guys,I'm tryin to get started with REST and JPA using TomEE Plus v1.5.1
and Derby.The REST part of it is all right, it's the JPA part that's drivin
me nuts.*Here are the Datasources defined in tomee.xml:*... JdbcDriver
org.apache.derby.jdbc.EmbeddedDriver JdbcUrl
jdbc:derby://localhost:1527/test_db;create=true JtaManaged true
JdbcDriver org.apache.derby.jdbc.EmbeddedDriver JdbcUrl
jdbc:derby://localhost:1527/test_db;create=true JtaManaged false...*The
persistence.xml:*<?xml version="1.0" encoding="UTF-8"?>
org.apache.openjpa.persistence.PersistenceProviderImpl test_ds
test_ds_unmanaged de.mdesign.hellorest.entity.HelloEntity For the
sake of completeness, here is the whole rest of the test webapp ...*The
entity class:*@Entity@Table(name = "HELLO_ENTITY")@TableGenerator(name =
"HelloEntityId", table = "ID_POOL", pkColumnName = "GEN_KEY",
valueColumnName = "GEN_VALUE", pkColumnValue =
"HELLO_ENTITY_ID")@NamedQueries({ @NamedQuery(name = "HelloEntity.findAll",
query = "SELECT h FROM HelloEntity h") })public class HelloEntity implements
Serializable { @Id @GeneratedValue(strategy = GenerationType.TABLE,
generator = "HelloEntityId") private Long id; @Column private String
name;...}*And finally the
REST-Service:*@Path("/rest")@Produces({MediaType.TEXT_PLAIN})public class
HelloRest { @PersistenceContext(unitName = "test_pu") private EntityManager
em; @PUT @Path("/create") public String createEntry(@QueryParam("name")
String name) { HelloEntity hello = new HelloEntity(); hello.setName(name);
hello = em.merge(hello); return ("Hello "+hello.getName()+"
(id="+hello.getId()+")"); }...}I get no errors or warnings or whatever on
TomEE startup and webapp deployment.All datasources defined get created.All
entities are found.What am I doin wrong ?
--
View this message in context: http://openejb.979440.n4.nabble.com/Derby-database-does-not-get-created-tp4661164.html
Sent from the OpenEJB User mailing list archive at Nabble.com.