public AuthorEntity createEntry() { if (getClass() == AuthorEntity.class) return (AuthorEntity) this; AuthorEntity entity = new AuthorEntity(); entity.setHasUpdates(hasUpdates); entity.setId(id); entity.setHasAvatar(hasAvatar); entity.setHasAbout(hasAbout); entity.setDateBirth(dateBirth); entity.setRate(rate); entity.setSize(size); entity.setKudoed(kudoed); entity.setLink(link); entity.setNewest(newest); entity.setShortName(getShortName()); entity.setFullName(fullName); entity.setAnnotation(annotation); entity.setEmail(email); entity.setWorkCount(workCount); entity.setSectionAnnotation(sectionAnnotation); entity.setGender(getGender()); entity.setAbout(about); entity.setViews(views); entity.setAddress(address); entity.setParsed(parsed); entity.setSite(site); entity.setLastUpdateDate(lastUpdateDate); for (Category category : categories) { category.setAuthor(entity); entity.addCategory(category.createEntry()); } for (Work recommendation : recommendations) { recommendation.setAuthor(entity); entity.addRecommendation(recommendation.createEntity()); } for (Work rootWork : rootWorks) { rootWork.setRootAuthor(entity); entity.addRootLink(rootWork.createEntity()); } for (Link rootLink : rootLinks) { rootLink.setRootAuthor(entity); entity.addRootLink(rootLink.createEntity()); } for (Author author : friendList) { entity.addFriend(author.createEntry()); } for (Author author : friendOfList) { entity.addFriendOf(author.createEntry()); } return entity; }
public Author(Author other) { this.id = other.getId(); this.link = other.getLink(); this.fullName = other.getFullName(); this.shortName = other.getShortName(); this.email = other.getEmail(); this.annotation = other.getAnnotation(); this.gender = other.getGender(); this.dateBirth = other.getDateBirth(); this.address = other.getAddress(); this.site = other.getSite(); this.hasAvatar = other.isHasAbout(); this.hasAbout = other.isHasAbout(); this.hasUpdates = other.isHasUpdates(); this.lastUpdateDate = other.getLastUpdateDate(); this.newest = other.isNewest(); this.size = other.getSize(); this.workCount = other.getWorkCount(); this.rate = other.getRate(); this.kudoed = other.getKudoed(); this.views = other.getViews(); this.about = other.getAbout(); this.sectionAnnotation = other.sectionAnnotation; this.recommendations = other.getRecommendations(); this.categories = other.getCategories(); this.rootLinks = other.getRootLinks(); this.rootWorks = other.getRootWorks(); this.friendList = other.getFriendList(); this.friendOfList = other.getFriendOfList(); this.friends = other.getFriends(); this.friendsOf = other.getFriendsOf(); this.parsed = other.isParsed(); }