public class CustomPersister implements EntityPersister { private static final IdentifierGenerator GENERATOR = new UUIDHexGenerator();
public static void main( String[] args ) throws Exception { Properties props = new Properties(); props.setProperty("separator", "/"); IdentifierGenerator gen = new UUIDHexGenerator(); ( (Configurable) gen ).configure(Hibernate.STRING, props, null); IdentifierGenerator gen2 = new UUIDHexGenerator(); ( (Configurable) gen2 ).configure(Hibernate.STRING, props, null); for ( int i=0; i<10; i++) { String id = (String) gen.generate(null, null); System.out.println(id); String id2 = (String) gen2.generate(null, null); System.out.println(id2); } }
public static void main( String[] args ) throws Exception { Properties props = new Properties(); props.setProperty("separator", "/"); IdentifierGenerator gen = new UUIDHexGenerator(); ( (Configurable) gen ).configure(Hibernate.STRING, props, null); IdentifierGenerator gen2 = new UUIDHexGenerator(); ( (Configurable) gen2 ).configure(Hibernate.STRING, props, null); for ( int i=0; i<10; i++) { String id = (String) gen.generate(null, null); System.out.println(id); String id2 = (String) gen2.generate(null, null); System.out.println(id2); } }
private static final IdentifierGenerator UUID_GENERATOR = new UUIDHexGenerator();