title: @ElementCollection: Error Could not determine type for: java.util.Set, for columns
body: <p>Here is my Entity class</p>
  
  <pre><code>    @Entity // Model Class as a DB entity
      public class UserDetails 
      {
          @Id 
          private int userId;
          private String name;
  
          @ElementCollection
          private Set&lt;Address&gt; listOfAddresses = new HashSet();
  
             // Setters and Getters Below
  
      }
  </code></pre>
  
  <p>Here is my Address Class</p>
  
  <pre><code>    @Embeddable
      public class Address 
      {
     private String Street;
     private String City;
     private String State;
     private String PinCode;
  
         // Setters and Getters Below
       }
  </code></pre>
  
  <p>Am using a standalone Java Class to try and insert into my <strong>MySQL</strong> database. Since, am new to Hibernate I just want to use this annotation and not the relations for now.</p>
  
  <p>My standalone Java class named HibernateTest.java</p>
  
  <pre><code>       public class HibernateTest 
         {
  
  
        public static void main(String[] args) 
            {
      UserDetails user = new UserDetails();
      Address addr = new Address();
      user.setUserId(1);
      user.setName("Swateek");
  
      addr.setCity("Berhampur");
      addr.setPinCode("760001");
      addr.setState("Odisha");
      addr.setStreet("RKN");
  
      user.getListOfAddresses().add(addr);
  
      Address addrOff = new Address();
  
      addrOff.setCity("Bangalore");
      addrOff.setPinCode("560037");
      addrOff.setState("MTH");
      addrOff.setStreet("YH");
  
      user.getListOfAddresses().add(addrOff);
  
      SessionFactory sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
  
  
      Session session = sessionFactory.openSession();
  
      session.beginTransaction(); 
      session.save(user);
      session.getTransaction().commit(); 
         }
  
     } 
  </code></pre>
  
  <p>Now when I run the class HibernateTest I find this exception coming up. I have no clue why.</p>
  
  <pre><code>    Exception in thread "main" org.hibernate.MappingException: Could not determine type for: java.util.Set, for columns:
  </code></pre>