开发者

Possible to upgrade jboss 5.1 jpa1 to jpa 2

Is it possible to upgrade Hibernate/JPA that is shipped with JBoss 5.1 to use JP开发者_开发技巧A 2.0? I am interested in making use of the OrderColumn.

I am unable to upgrade JBoss to the latest version - 6


Is it possible to upgrade Hibernate/JPA that is shipped with JBoss 5.1 to use JPA 2.0?

No.

I am interested in making use of the OrderColumn.

Hibernate has an @IndexColumn equivalent.

2.4.6.2.1. List

Beyond EJB3, Hibernate Annotations supports true List and Array. Map your collection the same way as usual and add the @IndexColumn. This annotation allows you to describe the column that will hold the index. You can also declare the index value in DB that represent the first element (aka as base index). The usual value is 0 or 1.

@OneToMany(cascade = CascadeType.ALL)
@IndexColumn(name = "drawer_position", base=1)
public List<Drawer> getDrawers() {
    return drawers;
}

References

  • Hibernate Annotations 3.4 Reference Guide
    • 2.4.6.2. Extra collection types in the documentation.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜