1

在 java 6 中,以下行编译但是在 Java 7 中我得到一个不兼容的类型错误(见下文)。有什么想法吗?

Player player = new FPlayer();
player.setId("SomeString");
player.setWId(123456, "SomeString");

Key<Player> keyForPlayer = ofy().save().entity(player).now();

获取编译时错误

incompatible types
required: com.googlecode.objectify.Key<com.XX.XXXXXX.XXXXX.XXXXXX.Player>
found:    com.googlecode.objectify.Key<java.lang.Object>
4

0 回答 0