GWT 2.4 ValidationTool在ValueProxy上的Date属性上失败

时间:2012-08-09 21:03:52

标签: java gwt gwt-validation

我现在在网上浏览了几个小时,但我没有找到任何暗示。 我目前正在学习GWT(从2.4.0开始),我正在设置一个RequestFactory。在我运行注释处理器之前,一切都很顺利。

以下是相关的代理类:

@ProxyFor(value = PlaylistModel.class)
public interface PlaylistProxy extends ValueProxy {

    Long getPlaylistId();

    String getPlaylistName();

    void setPlaylistName(String playlistName);

    Date getPlaylistStartTime();

    void setPlaylistStartTime(Date playlistStartTime);
}

但是注释处理器给了我以下错误:

error: Could not find domain method similar to java.util.Date getPlaylistStartTime()
error: Could not find domain method similar to void setPlaylistStartTime(java.util.Date)

对我来说,似乎问题是由java.util.Date返回值和参数引起的,尽管official documentation表示此类型是可传输类型。

将代理的类型是:

public class PlaylistModel implements Serializable {

    private static final long serialVersionUID = 7476233813742570809L;

    private Long playlistId;

    @NotNull
    @Size(min = 1)
    private String playlistName;

    private Date playlistStartDate;

    private ChannelModel channel;

    public Long getPlaylistId() {
        return playlistId;
    }

    public void setPlaylistId(final Long playlistId) {
        this.playlistId = playlistId;
    }

    public String getPlaylistName() {
        return playlistName;
    }

    public void setPlaylistName(final String playlistName) {
        this.playlistName = playlistName;
    }

    public Date getPlaylistStartDate() {
        return playlistStartDate;
    }

    public void setPlaylistStartDate(final Date playlistStartDate) {
        this.playlistStartDate = playlistStartDate;
    }

    public ChannelModel getChannel() {
        return channel;
    }

    public void setChannel(final ChannelModel channel) {
        this.channel = channel;
    }
}

有谁能请我指出正确的方向?

1 个答案:

答案 0 :(得分:0)

getPlaylistStartTimegetPlaylistStartDate