There is a workaround without changing the sleep model. I prefer this way because all changes are in the jsf layer.
You can use binding in a composite component. The following code is an example with rich: calendar (which uses java.util.Date)
... < cc: interface componentType = "CalendarComponent" >
... </.: >
<cc:implementation>
... < rich: calendar value = "# {cc.attrs.value}" binding = "# {cc.attrs.calendar}" / >
...
& ;/.: >
...
CalendarComponent:
import java.util.Date;
import javax.faces.component.FacesComponent;
import javax.faces.component.UINamingContainer;
import javax.faces.context.FacesContext;
import org.richfaces.component.UICalendar;
@FacesComponent(value = "CalendarComponent")
public class CalendarComponent extends UINamingContainer {
@Override
public void processUpdates(FacesContext context) {
Object o = calendar.getValue();
if (o instanceof Date) {
Date d = (Date) o;
calendar.setValue(new java.sql.Date(d.getTime()));
}
super.processUpdates(context);
}
private UICalendar calendar;
public UICalendar getCalendar() {
return calendar;
}
public void setCalendar(UICalendar calendar) {
this.calendar = calendar;
}
}