Package org.company.recordshop.domain

Examples of org.company.recordshop.domain.Artist


  /**
   * {@inheritDoc}
   */
  public ArtistDto readArtistAsArtistDto(Long id) {
    Artist result = customerServiceModelDomainService.readArtist(id);
    return (result == null) ? null : artistDtoTranslator.toDto(result);
  }
View Full Code Here


  /**
   * {@inheritDoc}
   */
  public void updateArtist(ArtistDto object) {
    Artist domainObject = customerServiceModelDomainService
        .readArtist(object.getId());
    artistDtoTranslator.fromDto(object, domainObject);
    customerServiceModelDomainService.updateArtist(domainObject);
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void deleteArtist(ArtistDto object) {
    Assert.notNull(object, "argument [object] may not be null");
    Artist existing = customerServiceModelDomainService.readArtist(object
        .getId());
    customerServiceModelDomainService.deleteArtist(existing);
  }
View Full Code Here

      } else {

        /* An existing object to be updated */
        if (target.getFromIdols(element.getId()) == null) {
          // Element is not in target yet, read it from the store and add to target
          Artist original = artistDao.retrieve(element.getId());
          Artist updated = artistDtoTranslator.fromDto(element,
              original, translated);
          target.addToIdols(updated);
        } else {
          // Element is in target already, use this object. No need to add to the collection
          artistDtoTranslator.fromDto(element, target
              .getFromIdols(element.getId()), translated);
        }
      }
    }

    /*
     * Synchronize RelatedTo association.
     */
    Set<Artist> relatedToToBeRemoved = new HashSet<Artist>();
    /* Avoid changing the collection underneath an active iterator. */
    for (Artist element : target.getRelatedTo()) {
      if (source.getFromRelatedTo(element.getId()) == null) {
        relatedToToBeRemoved.add(element);
      }
    }
    /* Objects to be removed */
    for (Artist element : relatedToToBeRemoved) {
      target.removeFromRelatedTo(element);
    }
    for (DisLikesDto element : source.getRelatedTo()) {
      if (element.getId() == null) {
        /* A new object to be added */
        target.addToRelatedTo(disLikesDtoTranslator.fromDto(element,
            translated));
      } else {

        /* An existing object to be updated */
        if (target.getFromRelatedTo(element.getId()) == null) {
          // Element is not in target yet, read it from the store and add to target
          Artist original = artistDao.retrieve(element.getId());
          Artist updated = disLikesDtoTranslator.fromDto(element,
              original, translated);
          target.addToRelatedTo(updated);
        } else {
          // Element is in target already, use this object. No need to add to the collection
          disLikesDtoTranslator.fromDto(element, target
View Full Code Here

      } else {

        /* An existing object to be updated */
        if (target.getFromIdols(element.getId()) == null) {
          // Element is not in target yet, read it from the store and add to target
          Artist original = artistDao.retrieve(element.getId());
          Artist updated = artistDtoTranslator.fromDto(element,
              original, translated);
          target.addToIdols(updated);
        } else {
          // Element is in target already, use this object. No need to add to the collection
          artistDtoTranslator.fromDto(element, target
              .getFromIdols(element.getId()), translated);
        }
      }
    }

    /*
     * Synchronize RelatedTo association.
     */
    Set<Artist> relatedToToBeRemoved = new HashSet<Artist>();
    /* Avoid changing the collection underneath an active iterator. */
    for (Artist element : target.getRelatedTo()) {
      if (source.getFromRelatedTo(element.getId()) == null) {
        relatedToToBeRemoved.add(element);
      }
    }
    /* Objects to be removed */
    for (Artist element : relatedToToBeRemoved) {
      target.removeFromRelatedTo(element);
    }
    for (DisLikesDto element : source.getRelatedTo()) {
      if (element.getId() == null) {
        /* A new object to be added */
        target.addToRelatedTo(disLikesDtoTranslator.fromDto(element,
            translated));
      } else {

        /* An existing object to be updated */
        if (target.getFromRelatedTo(element.getId()) == null) {
          // Element is not in target yet, read it from the store and add to target
          Artist original = artistDao.retrieve(element.getId());
          Artist updated = disLikesDtoTranslator.fromDto(element,
              original, translated);
          target.addToRelatedTo(updated);
        } else {
          // Element is in target already, use this object. No need to add to the collection
          disLikesDtoTranslator.fromDto(element, target
View Full Code Here

    record3 = new Record("1234", 24.95F, RecordTypeEnum.BLUERAY);
    recordDao.add(record1);
    recordDao.add(record2);
    recordDao.add(record3);

    artist1 = new Artist("A1", "L1", date(), "A1");
    artist2 = new Artist("A2", "L2", date(), "A2");
    artist3 = new Artist("A3", "L3", date(), "A3");
    artistDao.add(artist1);
    artistDao.add(artist2);
    artistDao.add(artist3);
    flush();
  }
View Full Code Here

  public void testAddContributors() {
    assertEquals(0, countRowsInTable("Record_TABLE"));
    assertEquals(0, countRowsInTable("Artist_TABLE"));
    assertEquals(0, countRowsInTable("records_contributors"));
    Record record = new Record("Abbey Road", 25.50F, RecordTypeEnum.BLUERAY);
    Artist john = new Artist("John", "Lennon", date(),
        "singer/guitarist/songwriter");
    Artist paul = new Artist("Paul", "McCartney", date(), "singer/bass/songwriter");
    artistDao.add(john);
    artistDao.add(paul);

    record.addToContributors(john);
    record.addToContributors(paul);
View Full Code Here

TOP

Related Classes of org.company.recordshop.domain.Artist

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.