【发布时间】:2016-06-20 18:55:08
【问题描述】:
我正在尝试使用 hateoas 制作一个休息应用程序。
这是我的汇编类:
public class PlantInventoryEntryAssembler extends ResourceAssemblerSupport<PlantInventoryEntry, PlantInventoryEntryDTO>
{
}
PlantInventoryEntryDTO 类是:
@Data
public class PlantInventoryEntryDTO extends ResourceSupport{
Long id;
String name;
String description;
@Column(precision = 8, scale = 2)
BigDecimal price;
public Long idGetter (){
return id;
}
}
问题是,在@Data(我使用lombok)行中,我遇到了以下错误:
Multiple markers at this line
- overrides org.springframework.hateoas.ResourceSupport.equals
- The return type is incompatible with ResourceSupport.getId()
- Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If
this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type.
- overrides org.springframework.hateoas.ResourceSupport.toString
- overrides org.springframework.hateoas.ResourceSupport.hashCode
- overrides org.springframework.hateoas.ResourceSupport.getId
我该如何处理?
更新:
PlantInventoryEntry 类
@Entity
@Data
public class PlantInventoryEntry {
@EmbeddedId
PlantInventoryEntryID id;
String name;
String description;
@Column(precision = 8, scale = 2)
BigDecimal price;
}
【问题讨论】:
标签: java rest spring-mvc lombok