Hi,
I am facing the same problem.and tried your solution.
But dint get the desired output.
Code:
public class CustomIdGenerator implements IdentifierGenerator
{
@Override
public Serializable generate(SessionImplementor sessionImplementor, Object object) throws HibernateException
{
try
{
System.out.println("in custom generator..."+object.getClass().getCanonicalName());
EntityPersister entityPersister = sessionImplementor.getEntityPersister("restaurantId", object);
Serializable id = entityPersister.getIdentifierGenerator().generate(sessionImplementor, "restaurantId");
System.out.println("id is "+id);
if(id == null)
{
return IdentifierGeneratorFactory.POST_INSERT_INDICATOR;
}
return id;
}
catch (Exception e)
{
System.out.println("in exception ");
System.out.println(e.getMessage());
return null;
}
}
}
please view the following link:
viewtopic.php?f=1&t=1015440Please help.
Regards,
Annuk