我的github

问题:

Entity
@Table(name = "ways")
@TypeDef(name = "hstore", typeClass = HstoreUserType.class)
@Cacheable
public class Way {

    /**
     * Primary key for the row in table.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;

    /**
     * The ID to represent it across the system.
     * Used for preserving historical information. 
     */
    @Column(name = "way_id")
    private Long wayId;

    /**
     * The version of the way this Object represents. 
     */
    @Column(name = "version")
    private Integer version;


    /**
     * The {@link User} that edited this version. 
     */
    @OneToOne
    @PrimaryKeyJoinColumn(name = "user_id")
    private User user;

    /**
     * Timestamp when this version of the Way was edited.
     */
    @Column(name = "tstamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timestamp;

    /**
     * The changeset that this version of the way belongs to. 
     */
    @Column(name = "changeset_id")
    private Long changesetId;

    /**
     * All the tags this Way contains. 
     */
    @Type(type = "hstore")
    @Column(name = "tags", columnDefinition = "hstore")
    private Object2ObjectOpenHashMap<String, String> tags = new Object2ObjectOpenHashMap<String, String>(); 

    @Column(name = "bbox")
    private Geometry bbox;

    @Column(name = "linestring")
    private Geometry linestring;

    @Column(name = "nodes")
    private Long[] nodes;

    // getters and setters
}

参考:https://www.e-learn.cn/topic/2693163    https://stackoverflow.com/questions/23049498/hibernate-could-not-deserialize-invalid-stream-header

加上implement Serializable没用,把DateTime改成Date就好了。。没用converter。。。

posted on 2023-03-10 11:56  XiaoNiuFeiTian  阅读(67)  评论(0编辑  收藏  举报