Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package org.cqu.budgetcars.controllers;
- import java.util.List;
- import javax.ejb.EJB;
- import javax.inject.Named;
- import javax.enterprise.context.RequestScoped;
- import javax.persistence.EntityManager;
- import javax.persistence.EntityTransaction;
- import org.cqu.budgetcars.myentities.Customer;
- import org.cqu.budgetcars.myentities.mysessionbeans.CustomerEJB;
- /**
- *
- * @author kenta
- */
- @Named(value = "customerController")
- @RequestScoped
- public class CustomerController {
- @EJB
- private CustomerEJB customerEJB;
- private List<Customer> customers;
- private Customer customer = new Customer();
- /**
- * Creates a new instance of CustomerController
- */
- public CustomerController() {
- }
- public String doCreate(){
- customerEJB.create(customer);
- return "listCustomers.xhtml";
- }
- public CustomerEJB getCustomerEJB() {
- return customerEJB;
- }
- public void setCustomerEJB(CustomerEJB customerEJB) {
- this.customerEJB = customerEJB;
- }
- public List<Customer> getCustomers() {
- return customers;
- }
- public void setCustomers(List<Customer> customers) {
- this.customers = customers;
- }
- public Customer getCustomer() {
- return customer;
- }
- public void setCustomer(Customer customer) {
- this.customer = customer;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement