title: Hibernate: How to generate Id from entity constructor parameters?
body: <p>How to generate id for entity using constructor parameters - is that possible ? I need that to make tree structure (category -> subcategories...) passing to constructor parent category id.</p>
  
  <pre><code>Category category = new Category(parentId);
  CategoryDAO.add(category);
  </code></pre>