Пример #1
0
  public void saveImage(File file) {

    MyClub myClub = data.getEntityById(MyClub.class, 1);
    if (myClub == null) {

      MyClub newClub = new MyClub();
      newClub.setId(1);
      newClub.setLogo(this.fileToByteArray(file));
      data.persist(newClub);
      return;
    }

    myClub.setLogo(this.fileToByteArray(file));
    data.update(myClub);
  }
Пример #2
0
  public void storeImage(byte[] image) {

    MyClub myClub = data.getEntityById(MyClub.class, 1);
    myClub.setLogo(image);
    data.update(myClub);
  }