0

我现在在网上浏览了几个小时,但没有找到任何提示。我目前正在学习 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 返回值和参数引起的,尽管官方文档告诉这个类型是可传输类型。

将被代理的类型是:

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;
    }
}

谁能指出我正确的方向?

4

1 回答 1

0

getPlaylistStartTime对比getPlaylistStartDate

于 2012-08-10T08:11:57.913 回答