package de.dominikschadow.fwm;

import de.dominikschadow.fwm.session.LoginBean;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.List;

@ManagedBean
@RequestScoped
public class FerrisWheelBean {
    @PersistenceContext(unitName = "fwm")
    private EntityManager em;

    @ManagedProperty("#{loginBean}")
    private LoginBean loginBean;

    public List<FerrisWheel> getFerrisWheels() {
        Query query = em.createQuery("from FerrisWheel w where w.user=:user");
        query.setParameter("user", loginBean.getCurrentUser());

        List<FerrisWheel> results = query.getResultList();

        return results;
    }

    public String createFerrisWheel() {
        return "/users/index";
    }

    public void setLoginBean(LoginBean loginBean) {
        this.loginBean = loginBean;
    }
}

@@ -889,32 +889,78 @@
 /index%22;%0A    %7D%0A%0A
+    public void deleteFerrisWheel() %7B%0A%0A    %7D%0A%0A
     public void 

Delete dummy