---
title: "appfuse xdoclet 生成hbm.xml中的序列号"
author: "jackdraw"
date: "2007-08-25T09:11:42Z"
tags: []
slug: "appfuse-xdoclet-hbm-xml"
draft: false
lastmod: "2007-08-25T09:11:42Z"
id: 116588
url: "https://jackdraw.iteye.com/blog/116588"
---

/\**  
     * @hibernate.id column="id" generator-class="sequence" type="long" unsaved-value="null"  
     * @hibernate.generator-param name="sequence" value="s\_role"  
     \*/  
    public Long getId() {  
        return id;  
    }  
结果

   &lt;!-- The generator-class attribute of @hibernate.id is deprecated, use the @hibernate.generator tag instead --&gt;  
    &lt;generator class="sequence"&gt;

        &lt;!-- The generator-param tag is deprecated, use the @hibernate.generator and @hibernate.param tags instead --&gt;  
        &lt;param name="sequence" &gt;  
            s\_role  
        &lt;/param&gt;

    &lt;/generator&gt;