Hi everyone:
In a application,I want to use myself identifier ID.So I want to implements the IdentifierGenerator.But I can't understand the example code:
Code:
public class SessionBeanHiLoGenerator implements IdentifierGenerator {
public Serializable generate(SessionImplementor session, Object object)
throws HibernateException {
try {
return HiLoGeneratorUtil.getHome().create().next();
}
catch (Exception e) {
throw new IDGenerationException( "Could not generate id: " + e.getMessage() );
}
}
}
what it returned is Serializable? what I expected is that the id generator class will return a String. How to implement my id generator and return String as id?
Please show me a example Thks in advanced!