Wiki

Clone wiki

MagDownloads / Arquillian - Listing 3

@Named
@RequestScoped
public class PoolController {
    @EJB
    PoolFacade poolFacade;

    private List<Pool> poolList;

    private Pool current;

    @PostConstruct
    public void init(){
        poolList = new ArrayList();

        Pool pool = new Pool();
        pool.setId(1);
        pool.setGallons(new Double(25000));
        pool.setLength(new Double(32));
        pool.setWidth(new Double(16));
        pool.setShape("RECTANGLE");

        poolList.add(pool);

        pool = new Pool();
        pool.setId(2);
        pool.setGallons(new Double(15000));
        pool.setRadius(new Double(24));
        pool.setShape("CIRCLE");

        poolList.add(pool);
    }

    public void create(){

    }

    public Pool getCurrent(){
        if(current == null){
            current = new Pool();
        }
        return current;
    }

    // Getters and Setters
   . . . 
}

Updated