Hibernate Generated properties

pioneerDev 发布于 2017/07/05 08:41
阅读 146
收藏 0
@Generated( value = GenerationTime.ALWAYS )
    @Column(columnDefinition =
        "AS CONCAT(" +
        "    COALESCE(firstName, ''), " +
        "    COALESCE(' ' + middleName1, ''), " +
        "    COALESCE(' ' + middleName2, ''), " +
        "    COALESCE(' ' + middleName3, ''), " +
        "    COALESCE(' ' + middleName4, ''), " +
        "    COALESCE(' ' + middleName5, ''), " +
        "    COALESCE(' ' + lastName, '') " +
        ")")
    private String fullName;

以上是Hibernate User Guide里的一个栗子,实现以上的逻辑,在MySQL数据库中,需要怎样改写?

加载中
返回顶部
顶部