title: HiLo generator strategy not working
body: <p>I am new to hibernate. What I am trying to do is use <code>@CollectionId</code>to generate an identifier for my Address class. I have used <code>Collection</code> interface for this. However when I use <code>@GenericGenerator</code> and set strategy to hilo, it throws an Exception.
  Here's my code:</p>
  
  <pre><code>@Entity
  @Table(name = "USER_DETAILS")
  public class UserDetails {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int userId;
      private String userName;
  
      @ElementCollection
      @JoinTable(name="USER_ADDRESS",
          joinColumns=@JoinColumn(name="USER_ID")
      )
  
      @GenericGenerator(name = "hilo-gen", strategy = "hilo")
      @CollectionId(columns = { @Column(name="ADDRESS_ID") }, generator = "hilo-gen", type = @Type(type="long"))
      private Collection&lt;Address&gt; address = new ArrayList&lt;Address&gt;();
  
      public int getUserId() {
          return userId;
      }
  
      public void setUserId(int userId) {
          this.userId = userId;
      }
  
      public String getUserName() {
          return userName;
      }
  
      public void setUserName(String userName) {
          this.userName = userName;
      }
  
      public Collection&lt;Address&gt; getAddress() {
          return address;
      }
  
      public void setAddress(List&lt;Address&gt; address) {
          this.address = address;
      }
  }
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code>Exception in thread "main" org.hibernate.MappingException: Could not instantiate id generator [entity-name=null]
      at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:121)
      at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:259)
      at org.hibernate.persister.collection.AbstractCollectionPersister.&lt;init&gt;(AbstractCollectionPersister.java:429)
      at org.hibernate.persister.collection.BasicCollectionPersister.&lt;init&gt;(BasicCollectionPersister.java:57)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at org.hibernate.persister.internal.PersisterFactoryImpl.createCollectionPersister(PersisterFactoryImpl.java:152)
      at org.hibernate.persister.internal.PersisterFactoryImpl.createCollectionPersister(PersisterFactoryImpl.java:140)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:408)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
      at com.hbt.HibernateTest.main(HibernateTest.java:35)
  Caused by: java.lang.UnsupportedOperationException: Support for 'hilo' generator has been removed
      at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.getIdentifierGeneratorClass(DefaultIdentifierGeneratorFactory.java:132)
      at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:112)
      ... 14 more
  </code></pre>
  
  <p>I am using the latest hibernate. What should I do?</p>