Package org.albertsanso.web20.wines.dao.jpa

Examples of org.albertsanso.web20.wines.dao.jpa.JPAWineDao


*/
  }
 
  private void setRelations() {
   
    JPAUserDao userDao = new JPAUserDao();
    JPAWineDao wineDao = new JPAWineDao();
    userDao.setEntityManager(em);
    wineDao.setEntityManager(em);
   
    User user1 = userDao.findByNameAndSurname("Albert", "Sans�");
    User user2 = userDao.findByNameAndSurname("Sergi", "Alegre");
   
    Wine wine1 = wineDao.findByName("El meu vi");
    Wine wine2 = wineDao.findByName("El meu vi 2");
    Wine wine3 = wineDao.findByName("El meu vi 3");
   
View Full Code Here


    wineDao.save(wine);
  }
 
  private void createPeople() {
   
    JPAUserDao userDao = new JPAUserDao();
    userDao.setEntityManager(em);
   
    User user = new User();
    user.setFirstName("Albert");
    user.setSecondName("Sanso");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Angels");
    user.setSecondName("Garrido");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Rafel");
    user.setSecondName("Sanso");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Cristina");
    user.setSecondName("Sanso");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Helena");
    user.setSecondName("Trenchs");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Sergi");
    user.setSecondName("Alegre");
    userDao.save(user);
  }
View Full Code Here


   
    em.getTransaction().begin();
   
    Article art = new Article();
    art.setName("article1");
    art.setSummary("Aquest es l'article 1");
    em.persist(art);

   
    art = new Article();
    art.setName("article2");
    art.setSummary("Aquest es l'article 2");
    em.persist(art);
 
   
    art = new Article();
    art.setName("article3");
    art.setSummary("Aquest es l'article 3");
    em.persist(art);

   
    Photo photo = new Photo();
    photo.setComment("vaya fotito...");
View Full Code Here

    photo.setComment("vaya fotito...");
    photo.setName("foto borracho");
    em.persist(photo);


    NominalAttribute wineColor = new NominalAttribute();
    wineColor.setName("color");
    wineColor.setValue("RED");
   
    NominalAttribute DO = new NominalAttribute();
    DO.setName("DO");
    DO.setValue("Priorat");
   
    NominalAttribute macerationCask = new NominalAttribute();
    macerationCask.setName("maceration_cask");
    macerationCask.setValue("FRENCH_OAK");
   
    NumericalAttribute macerationTimeMonths = new NumericalAttribute();
    macerationTimeMonths.setName("maceration_months");
    macerationTimeMonths.setValue(8.0);
View Full Code Here

   
    NominalAttribute macerationCask = new NominalAttribute();
    macerationCask.setName("maceration_cask");
    macerationCask.setValue("FRENCH_OAK");
   
    NumericalAttribute macerationTimeMonths = new NumericalAttribute();
    macerationTimeMonths.setName("maceration_months");
    macerationTimeMonths.setValue(8.0);

    NumericalAttribute alcoholGrade = new NumericalAttribute();
    alcoholGrade.setName("alcohol");
    alcoholGrade.setValue(13.5);
   
    NumericalAttribute[] varietalPercent = new NumericalAttribute[3];
    varietalPercent[0] = new NumericalAttribute();
    varietalPercent[0].setName("varietal_tempranillo");
    varietalPercent[0].setValue(40.0);
    varietalPercent[1] = new NumericalAttribute();
    varietalPercent[1].setName("varietal_cabernet_sauvignon");
    varietalPercent[1].setValue(60.0);
    varietalPercent[2] = new NumericalAttribute();
    varietalPercent[2].setName("varietal_sirah");
    varietalPercent[2].setValue(10.0);
   

   
View Full Code Here

    art.setName("article3");
    art.setSummary("Aquest es l'article 3");
    em.persist(art);

   
    Photo photo = new Photo();
    photo.setComment("vaya fotito...");
    photo.setName("foto borracho");
    em.persist(photo);


    NominalAttribute wineColor = new NominalAttribute();
    wineColor.setName("color");
View Full Code Here

 
  private void createPeople() {
   
    em.getTransaction().begin();
   
    User user1 = new User();
    user1.setFirstName("Albert");
    user1.setSecondName("Sans�");
   
    User user2 = new User();
    user2.setFirstName("Sergi");
    user2.setSecondName("Alegre");
   
    User user3 = new User();
    user3.setFirstName("Helena");
    user3.setSecondName("Trenchs");
   
    em.persist(user1);
    em.persist(user2);
    em.persist(user3);
   
View Full Code Here

    JPAUserDao userDao = new JPAUserDao();
    JPAWineDao wineDao = new JPAWineDao();
    userDao.setEntityManager(em);
    wineDao.setEntityManager(em);
   
    User user1 = userDao.findByNameAndSurname("Albert", "Sans�");
    User user2 = userDao.findByNameAndSurname("Sergi", "Alegre");
   
    Wine wine1 = wineDao.findByName("El meu vi");
    Wine wine2 = wineDao.findByName("El meu vi 2");
    Wine wine3 = wineDao.findByName("El meu vi 3");
   
View Full Code Here

  private void createPeople() {
   
    JPAUserDao userDao = new JPAUserDao();
    userDao.setEntityManager(em);
   
    User user = new User();
    user.setFirstName("Albert");
    user.setSecondName("Sanso");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Angels");
    user.setSecondName("Garrido");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Rafel");
    user.setSecondName("Sanso");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Cristina");
    user.setSecondName("Sanso");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Helena");
    user.setSecondName("Trenchs");
    userDao.save(user);
   
    user = new User();
    user.setFirstName("Sergi");
    user.setSecondName("Alegre");
    userDao.save(user);
  }
View Full Code Here

import org.albertsanso.web20.core.model.User;

public class JPAUserDao extends JPABaseDaoImpl implements UserDao {

  public User findById(long id) {
    User user = entityManager.find(User.class, id);
    return user;
  }
View Full Code Here

TOP

Related Classes of org.albertsanso.web20.wines.dao.jpa.JPAWineDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.