[
http://jira.jboss.com/jira/browse/JBIDE-1955?page=comments#action_12404813 ]
super watano commented on JBIDE-1955:
-------------------------------------
//$Id: BookingListAction.java 6987 2007-12-23 19:53:07Z pmuir $
package org.jboss.seam.example.hibernate;
// import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
import static org.jboss.seam.ScopeType.SESSION;
import java.io.Serializable;
import java.util.List;
import org.hibernate.Session;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.annotations.datamodel.DataModelSelection;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.log.Log;
@Scope(SESSION)
@Name("bookingList")
// @TransactionAttribute(REQUIRES_NEW)
public class BookingListAction implements Serializable
{
@In
private Session bookingDatabase;
@In
private User user;
@DataModel
private List<Booking> bookings;
@DataModelSelection
private Booking booking;
@Logger
private Log log;
@Factory
@Observer("bookingConfirmed")
@Transactional
public void getBookings()
{
bookings = bookingDatabase.createQuery("select b from Booking b where
b.user.username = :username order by b.checkinDate")
.setParameter("username", user.getUsername())
.list();
}
public void cancel()
{
log.info("Cancel booking: #{bookingList.booking.id} for
#{user.username}");
Booking cancelled = (Booking) bookingDatabase.get(Booking.class, booking.getId());
if (cancelled!=null) bookingDatabase.delete( cancelled );
getBookings();
FacesMessages.instance().add("Booking cancelled for confirmation number
#{bookingList.booking.id}");
}
public Booking getBooking()
{
return booking;
}
}
error "Factory method "getBookings" with a void return
type must have an associated @Out/Databinder"
-----------------------------------------------------------------------------------------------------
Key: JBIDE-1955
URL:
http://jira.jboss.com/jira/browse/JBIDE-1955
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: Seam
Affects Versions: 2.0.1
Environment: Eclipse IDE for Java EE Developers (Version: 3.3.2 Build id:
M20080221-1800) + jboss-seam-2.0.1.GA + hibernate tomcat6 examples
Reporter: super watano
eclipse will report an error on problems like this:
Severity and Description Path Resource Location Creation Time Id
Factory method "getBookings" with a void return type must have an associated
@Out/Databinder elanceclone/WEB-INF/src/java/org/jboss/seam/example/hibernate BookingListAction.java line
48 1206419587569 2234
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira