diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-01 08:30:03 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-01 08:30:03 +0000 |
commit | f62b9397697d93c6db68c877ed21de2758202c2f (patch) | |
tree | 9eba305e7320ad74ecca4cf4143d0e51d2f8ab90 /sandbox/lresende/sca/samples/customer-dojo-webapp/src/main/java/customer/CustomerCollectionImpl.java | |
parent | 78c9e1f78b2a35a7d3a13cd064d371478b0eb86c (diff) |
Corrupted commit
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@681630 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/lresende/sca/samples/customer-dojo-webapp/src/main/java/customer/CustomerCollectionImpl.java')
-rw-r--r-- | sandbox/lresende/sca/samples/customer-dojo-webapp/src/main/java/customer/CustomerCollectionImpl.java | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/sandbox/lresende/sca/samples/customer-dojo-webapp/src/main/java/customer/CustomerCollectionImpl.java b/sandbox/lresende/sca/samples/customer-dojo-webapp/src/main/java/customer/CustomerCollectionImpl.java deleted file mode 100644 index c0a2f25f15..0000000000 --- a/sandbox/lresende/sca/samples/customer-dojo-webapp/src/main/java/customer/CustomerCollectionImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package customer; - -import java.util.Iterator; -import java.util.List; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.EntityTransaction; -import javax.persistence.Persistence; -import javax.persistence.Query; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; - - -public class CustomerCollectionImpl implements CustomerCollection { - EntityManagerFactory emf = null; - EntityManager em = null; - - public CustomerCollectionImpl() { - System.out.println(">>>"); - try { - emf = Persistence.createEntityManagerFactory("customer-openJPA"); - em = emf.createEntityManager(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void delete(String arg0) throws NotFoundException { - // TODO Auto-generated method stub - - } - - public Customer get(String arg0) throws NotFoundException { - // TODO Auto-generated method stub - return null; - } - - public Entry<String, Customer>[] getAll() { - EntityTransaction tx = em.getTransaction(); - try { - tx.begin(); - - Query q = em.createQuery("SELECT c FROM customer c"); - List results = q.getResultList(); - Iterator iter = results.iterator(); - while (iter.hasNext()) { - Customer customer = (Customer)iter.next(); - - System.out.println(customer); - } - - tx.commit(); - } catch(Exception e) { - e.printStackTrace(); - } finally { - if (tx.isActive()) { - tx.rollback(); - } - - em.close(); - } - - return null; - } - - public String post(String arg0, Customer arg1) { - // TODO Auto-generated method stub - return null; - } - - public void put(String arg0, Customer arg1) throws NotFoundException { - // TODO Auto-generated method stub - - } - - public Entry<String, Customer>[] query(String arg0) { - // TODO Auto-generated method stub - return null; - } - -} |