Guest User

Untitled

a guest
Jan 15th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. Session session = Main.getSession();
  2. session.beginTransaction();
  3. ProductsEntity productsEntity = new ProductsEntity();
  4. productsEntity.setName(nameTextField.getText());
  5. productsEntity.setDescription(descriptionTextArea.getText());
  6. productsEntity.setCategory((ProductCategoriesEntity) categoryComboBox.getSelectedItem());
  7. session.save(productsEntity);
  8. session.getTransaction().commit();
  9. session.close();
Advertisement
Add Comment
Please, Sign In to add comment