Java tutorial
package de.uniwue.info6.database.map; /* * #%L * ************************************************************************ * ORGANIZATION : Institute of Computer Science, University of Wuerzburg * PROJECT : UEPS - Uebungs-Programm fuer SQL * FILENAME : User.java * ************************************************************************ * %% * Copyright (C) 2014 - 2015 Institute of Computer Science, University of Wuerzburg * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ // Generated Oct 30, 2013 2:01:27 PM by Hibernate Tools 4.0.0 import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import de.uniwue.info6.database.map.daos.UserDao; /** * User generated by hbm2java */ public class User implements java.io.Serializable { // ****************************************************************** // custom (not generated methods) // ****************************************************************** @Override public int hashCode() { return new HashCodeBuilder(17, 31).append(id).toHashCode(); } @Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof User)) return false; User user = (User) obj; return new EqualsBuilder().append(id, user.getId()).isEquals(); } // ****************************************************************** // generated methods of hibernate // ****************************************************************** private String id; private Date lastModified; private Boolean isAdmin; private Boolean isLecturer; private String description; private Set userEntries = new HashSet(0); private Set userResults = new HashSet(0); private Set userRights = new HashSet(0); public User() { } public User(String id, Date lastModified) { this.id = id; this.lastModified = lastModified; } public User(String id, Date lastModified, Boolean isAdmin, Boolean isLecturer, String description, Set userEntries, Set userResults, Set userRights) { this.id = id; this.lastModified = lastModified; this.isAdmin = isAdmin; this.isLecturer = isLecturer; this.description = description; this.userEntries = userEntries; this.userResults = userResults; this.userRights = userRights; } public String getId() { return this.id; } public void setId(String id) { this.id = id; } public Date getLastModified() { return this.lastModified; } public void setLastModified(Date lastModified) { this.lastModified = lastModified; } public Boolean getIsAdmin() { return this.isAdmin; } public void setIsAdmin(Boolean isAdmin) { this.isAdmin = isAdmin; } public Boolean getIsLecturer() { return this.isLecturer; } public void setIsLecturer(Boolean isLecturer) { this.isLecturer = isLecturer; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public Set getUserEntries() { return this.userEntries; } public void setUserEntries(Set userEntries) { this.userEntries = userEntries; } public Set getUserResults() { return this.userResults; } public void setUserResults(Set userResults) { this.userResults = userResults; } public Set getUserRights() { return this.userRights; } public void setUserRights(Set userRights) { this.userRights = userRights; } public User pull() { return new UserDao().getById(getId()); } }