HTML and CSS Reference
In-Depth Information
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof UserGroup)) {
return false;
}
UserGroup other = (UserGroup) object;
if ((this.id == null && other.id != null) || (this.id != null &&
!this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.jsfprohtml5.megaapp.model.UserGroup[ id=" + id + " ]";
}
}
UserGroup JPA entity class has the following attributes:
id : Marked as a primary key for the entity using @Id annotation. It is an auto-generated attribute.
groupId : Represents the group ID (can be 1 for user group or 2 for administrator group).
userId : Represents the associated user object.
The third and last EJB Manager is BookRequestManager EJB. Listing 13-11 shows the EJB Local interface of
BookRequestManager EJB.
Listing 13-11. BookRequestManager Local EJB Interface
package com.jsfprohtml5.megaapp.service;
import com.jsfprohtml5.megaapp.model.BookRequest;
import com.jsfprohtml5.megaapp.service.exception.BookRequestAlreadyExists;
import com.jsfprohtml5.megaapp.service.exception.BookRequestNotFound;
import java.util.List;
import javax.ejb.Local;
@Local
public interface BookRequestManagerLocal {
public BookRequest sendBookRequest(BookRequest bookRequest) throws BookRequestAlreadyExists;
public void approveBookRequest(Integer bookRequestNumber) throws BookRequestNotFound;
public void rejectBookRequest(Integer bookRequestNumber) throws BookRequestNotFound;
public List<BookRequest> viewRequests(String userName, int status);
}
Search WWH ::




Custom Search