Ciao Sanne,
I don't have static code in my entities :(
The entity I'm trying to load is PortfolioVO. This class has an attribute of type RootVO.
I'm sending the code of these classes... Maybe you can see a problem...
Thanks in advance for your help,
Cristina
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
/*
* This file is part of Tidia-Ae Project.
*
* Tidia-Ae Project is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tidia-Ae Project is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tidia-Ae Project; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package br.fapesp.tidia.ae.common.portfolio.commontypes.vo;
import br.fapesp.tidia.ae.common.commontypes.vo.ObjectVO;
/**
* @hibernate.class table="PORTFOLIO"
*
*/
public class PortfolioVO extends ObjectVO {
private boolean disabled;
private RootVO rootFolder;
private TrashVO trashFolder;
private AssessedFolderVO assessmentFolder;
private ContextParticipantPortfolioVO ctxPart;
public PortfolioVO() {
super();
}
/**
* @param identifier
* @param rootFolder
* @param trashFolder
* @param ctxPart
*/
public PortfolioVO(Long identifier, RootVO rootFolder, TrashVO trashFolder, AssessedFolderVO aFolder,
ContextParticipantPortfolioVO ctxPart) {
super(identifier);
this.rootFolder = rootFolder;
this.trashFolder = trashFolder;
this.assessmentFolder = aFolder;
this.setDisabled(false);
this.setCtxPart(ctxPart);
}
/**
* @return Returns the deleted status.
*
* @hibernate.property column = "DISABLED" not-null = "true"
*/
public boolean getDisabled() {
return disabled;
}
/**
* @param status
* The status to set.
*/
public void setDisabled(boolean status) {
this.disabled = status;
}
/**
* @return Returns the rootFolder.
*
* @hibernate.many-to-one class =
* "br.fapesp.tidia.ae.common.portfolio.commontypes.vo.RootVO"
* column = "ROOT_ID" cascade="all"
*/
public RootVO getRootFolder() {
return rootFolder;
}
/**
* @param rootFolder
* The rootFolder to set.
*/
public void setRootFolder(RootVO rootFolder) {
this.rootFolder = rootFolder;
}
/**
* @return Returns the trashFolder.
*
* @hibernate.many-to-one class =
* "br.fapesp.tidia.ae.common.portfolio.commontypes.vo.TrashVO"
* column = "TRASH_ID" cascade="all"
*/
public TrashVO getTrashFolder() {
return trashFolder;
}
/**
* @param trashFolder
* The trashFolder to set.
*/
public void setTrashFolder(TrashVO trashFolder) {
this.trashFolder = trashFolder;
}
/**
* @return Returns the assessmentFolder.
* @hibernate.many-to-one class =
* "br.fapesp.tidia.ae.common.portfolio.commontypes.vo.AssessedFolderVO"
* column = "ASSESSMENT_ID" cascade="all"
*
*/
public AssessedFolderVO getAssessmentFolder() {
return assessmentFolder;
}
/**
* @param assessmentFolder The assessmentFolder to set.
*/
public void setAssessmentFolder(AssessedFolderVO assessmentFolder) {
this.assessmentFolder = assessmentFolder;
}
/**
* @hibernate.one-to-one class =
* "br.fapesp.tidia.ae.common.portfolio.commontypes.vo.ContextParticipantPortfolioVO"
* property-ref = "portfolio" cascade="all"
*/
public ContextParticipantPortfolioVO getCtxPart() {
return ctxPart;
}
public void setCtxPart(ContextParticipantPortfolioVO ctxPart) {
this.ctxPart = ctxPart;
ctxPart.setPortfolio(this);
}
public int hashCode() {
int hashCode = super.hashCode();
hashCode += Boolean.valueOf(this.getDisabled()).hashCode();
return hashCode;
}
public boolean equals(Object other) {
boolean isEquals = true;
if (this == other) {
isEquals = true;
} else if (other instanceof PortfolioVO) {
PortfolioVO portfolio = (PortfolioVO) other;
if (!portfolio.getId().equals(this.getId())) {
isEquals = false;
} else if (portfolio.disabled != this.disabled) {
isEquals = false;
}
} else {
isEquals = false;
}
return isEquals;
}
public String toString() {
StringBuffer buffer = new StringBuffer();
final String separator = ", ";
buffer.append("{");
buffer.append("id = " + this.getId() + separator);
buffer.append("disabled = " + this.getDisabled() + separator);
buffer.append("rootFolder = " + this.getRootFolder() + separator);
buffer.append("trashFolder = " + this.getTrashFolder());
buffer.append("}");
return buffer.toString();
}
}
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
/*
* This file is part of Tidia-Ae Project.
*
* Tidia-Ae Project is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tidia-Ae Project is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tidia-Ae Project; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package br.fapesp.tidia.ae.common.portfolio.commontypes.vo;
import java.util.Collection;
import java.util.Date;
/**
* @hibernate.subclass discriminator-value = "2"
*/
public class RootVO extends FolderVO {
private Collection children;
private PortfolioVO portfolio;
public RootVO() {
super();
}
/**
* @param name
* @param privateItensQty
* @param publicItensQty
* @param notCommPrivateItensQty
* @param notCommPublicItensQty
* @param lastUpdate
*/
public RootVO(String name, int privateItensQty, int publicItensQty,
int notCommPrivateItensQty, int notCommPublicItensQty,
Date lastUpdate) {
super(name, privateItensQty, publicItensQty, notCommPrivateItensQty,
notCommPublicItensQty, lastUpdate, null);
}
/**
* @param identifier
* @param name
* @param itensQty
* @param notCommPrivateItensQty
* @param notCommPublicItensQty
* @param notEvalQty
* @param lastUpdate
*/
public RootVO(Long identifier, String name, int privateItensQty,
int publicItensQty, int notCommPrivateItensQty,
int notCommPublicItensQty, Date lastUpdate) {
super(identifier, name, privateItensQty, publicItensQty,
notCommPrivateItensQty, notCommPublicItensQty, lastUpdate, null);
}
/**
* @return Returns the children.
*
* @hibernate.collection-one-to-many class =
* "br.fapesp.tidia.ae.common.portfolio.commontypes.vo.FolderVO"
* @hibernate.collection-key column = "PARENT_ID"
*
*/
public Collection getChildren() {
return children;
}
/**
* @param children
* The children to set.
*/
public void setChildren(Collection children) {
this.children = children;
}
/**
* @return Returns the portfolio.
* @hibernate.one-to-one class =
* "br.fapesp.tidia.ae.common.portfolio.commontypes.vo.PortfolioVO"
* property-ref = "rootFolder"
*/
public PortfolioVO getPortfolio() {
return portfolio;
}
/**
* @param portfolio
* The portfolio to set.
*/
public void setPortfolio(PortfolioVO portfolio) {
this.portfolio = portfolio;
}
}
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
/*
* This file is part of Tidia-Ae Project.
*
* Tidia-Ae Project is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tidia-Ae Project is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tidia-Ae Project; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package br.fapesp.tidia.ae.common.portfolio.commontypes.vo;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import br.fapesp.tidia.ae.common.commontypes.vo.ObjectVO;
/**
* @hibernate.class table="FOLDER" discriminator-value = "1"
* @hibernate.discriminator type = "byte" column = "TYPE"
*
*/
public class FolderVO extends ObjectVO {
private String name;
private int publicItensQty;
private int privateItensQty;
private int notCommPublicItensQty;
private int notCommPrivateItensQty;
private Date lastUpdate;
private FolderVO parent;
private Collection userStatus;
private boolean deleted;
private int order;
public FolderVO() {
super();
}
/**
* @param name
* @param publicItensQty
* @param privateItensQty
* @param notCommPrivateItensQty
* @param notCommPublicItensQty
* @param lastUpdate
*/
public FolderVO(String name, int privateItensQty, int publicItensQty, int notCommPrivateItensQty, int notCommPublicItensQty,
Date lastUpdate, FolderVO parent) {
super();
this.name = name;
this.publicItensQty = publicItensQty;
this.privateItensQty = privateItensQty;
this.notCommPrivateItensQty = notCommPrivateItensQty;
this.notCommPublicItensQty = notCommPublicItensQty;
this.lastUpdate = lastUpdate;
this.parent = parent;
}
/**
* @param identifier
* @param name
* @param publicItensQty
* @param privateItensQty
* @param notCommPrivateItensQty
* @param notCommPublicItensQty
* @param lastUpdate
* @param parent
*/
public FolderVO(Long identifier, String name, int privateItensQty, int publicItensQty, int notCommPrivateItensQty,
int notCommPublicItensQty, Date lastUpdate, FolderVO parent) {
super(identifier);
this.name = name;
this.publicItensQty = publicItensQty;
this.privateItensQty = privateItensQty;
this.notCommPrivateItensQty = notCommPrivateItensQty;
this.notCommPublicItensQty = notCommPublicItensQty;
this.lastUpdate = lastUpdate;
this.parent = parent;
}
/**
* @param folder
*/
public FolderVO(FolderVO folder) {
this.name = folder.getName();
this.publicItensQty = folder.getPublicItensQty();
this.privateItensQty = folder.getPrivateItensQty();
this.notCommPublicItensQty = folder.getNotCommPublicItensQty();
this.notCommPrivateItensQty = folder.getNotCommPrivateItensQty();
// this.notEvalQty = folder.getNotEvalQty();
this.lastUpdate = folder.getLastUpdate();
this.parent = folder.getParent();
this.deleted = folder.getDeleted();
}
/**
* @return Returns the name.
*
* @hibernate.property column="NAME" length="100" not-null="true"
*
*/
public String getName() {
return name;
}
/**
* @param name
* The name to set.
*/
public void setName(String name) {
this.name = name;
}
public void addPublicItensQty(int value) {
this.publicItensQty += value;
}
public void addPrivateItensQty(int value) {
this.privateItensQty += value;
}
public void addNotCommPrivateItensQty(int value) {
this.notCommPrivateItensQty += value;
}
public void addNotCommPublicItensQty(int value) {
this.notCommPublicItensQty += value;
}
/**
* @return Returns the notCommPrivateItensQty.
*
* @hibernate.property column = "NOT_COMM_PRIVATE_QTY" not-null = "true"
*/
public int getNotCommPrivateItensQty() {
return notCommPrivateItensQty;
}
/**
* @return Returns the notCommPublicItensQty.
*
* @hibernate.property column = "NOT_COMM_PUBLIC_QTY" not-null = "true"
*/
public int getNotCommPublicItensQty() {
return notCommPublicItensQty;
}
/**
* @param notCommPrivateItensQty
* The notCommPrivateItensQty to set.
*/
public void setNotCommPrivateItensQty(int notCommPrivateItensQty) {
this.notCommPrivateItensQty = notCommPrivateItensQty;
}
/**
* @param notCommPublicItensQty
* The notCommPublicItensQty to set.
*/
public void setNotCommPublicItensQty(int notCommPublicItensQty) {
this.notCommPublicItensQty = notCommPublicItensQty;
}
/**
* @return Returns the lastUpdate.
*
* @hibernate.property column = "LAST_UPDATE" not-null = "true"
*/
public Date getLastUpdate() {
return lastUpdate;
}
/**
* @param lastUpdate
* The lastUpdate to set.
*/
public void setLastUpdate(Date lastUpdate) {
this.lastUpdate = lastUpdate;
}
/**
* @return Returns the userStatus.
*
* @hibernate.set order-by = "USER_ID"
* @hibernate.collection-one-to-many class =
* "br.fapesp.tidia.ae.common.portfolio.commontypes.vo.FolderStatusVO"
* @hibernate.collection-key column = "FOLDER_ID"
*/
public Collection getUserStatus() {
return userStatus;
}
/**
* @param userStatus
* The userStatus to set.
*/
public void setUserStatus(Collection userStatus) {
this.userStatus = userStatus;
}
public Map getUserStatusMap() {
Map map = new HashMap();
Iterator iterator = this.getUserStatus().iterator();
FolderStatusVO folderStatus;
String userID;
Boolean status;
while (iterator.hasNext()) {
folderStatus = (FolderStatusVO) iterator.next();
userID = folderStatus.getUserID();
status = Boolean.valueOf(folderStatus.getReadStatus());
map.put(userID, status);
}
return map;
}
/**
* @return Returns the parent.
*
* @hibernate.many-to-one column="PARENT_ID"
*/
public FolderVO getParent() {
return parent;
}
/**
* @param parent
* The parent to set.
*/
public void setParent(FolderVO parent) {
this.parent = parent;
}
public String toString() {
StringBuffer buffer = new StringBuffer();
final String separator = ", ";
buffer.append("{");
buffer.append("id = " + this.getId() + separator);
buffer.append("name = " + this.getName() + separator);
buffer.append("lastUpdate = " + this.getLastUpdate() + separator);
buffer.append("publicItensQty = " + this.getPublicItensQty() + separator);
buffer.append("privateItensQty = " + this.getPrivateItensQty() + separator);
buffer.append("notCommPrivateItensQty = " + this.getNotCommPrivateItensQty() + separator);
buffer.append("notCommPublicItensQty = " + this.getNotCommPublicItensQty() + separator);
// buffer.append("notEvalQty = " + this.getNotEvalQty());
buffer.append("}");
return buffer.toString();
}
public int hashCode() {
int hashCode = super.hashCode();
if (this.name != null) {
hashCode += this.name.hashCode();
}
if (this.lastUpdate != null) {
hashCode += this.lastUpdate.hashCode();
}
return hashCode;
}
public boolean equals(Object obj) {
boolean isEquals = true;
if (obj == this) {
isEquals = true;
} else if (obj instanceof FolderVO) {
FolderVO folder = (FolderVO) obj;
if (!folder.getId().equals(this.getId())) {
isEquals = false;
} else if (! folder.getName().equals(this.name)) {
isEquals = false;
} else if (folder.publicItensQty != this.publicItensQty) {
isEquals = false;
} else if (folder.privateItensQty != this.privateItensQty) {
isEquals = false;
} else if (folder.notCommPrivateItensQty != this.notCommPrivateItensQty) {
isEquals = false;
} else if (folder.notCommPublicItensQty != this.notCommPublicItensQty) {
isEquals = false;
// } else if (folder.notEvalQty != this.notEvalQty) {
// isEquals = false;
} else {
long fTime = folder.getLastUpdate().getTime() / 1000;
long tTime = this.getLastUpdate().getTime() / 1000;
if (fTime != tTime) {
isEquals = false;
}
}
} else {
isEquals = false;
}
return isEquals;
}
/**
* @return Returns the status.
*
* @hibernate.property column = "DELETED" not-null = "true"
*/
public boolean getDeleted() {
return deleted;
}
/**
* @param deleted The deleted to set.
*/
public void setDeleted(boolean deleted) {
this.deleted = deleted;
}
/**
* @return Returns the privateItensQty.
*
* @hibernate.property column = "PRIVATE_QTY_ITENS" not-null = "true"
*/
public int getPrivateItensQty() {
return privateItensQty;
}
/**
* @param privateItensQty The privateItensQty to set.
*/
public void setPrivateItensQty(int privateItensQty) {
this.privateItensQty = privateItensQty;
}
/**
* @return Returns the publicItensQty.
*
* @hibernate.property column = "PUBLIC_QTY_ITENS" not-null = "true"
*/
public int getPublicItensQty() {
return publicItensQty;
}
/**
* @param publicItensQty The publicItensQty to set.
*/
public void setPublicItensQty(int publicItensQty) {
this.publicItensQty = publicItensQty;
}
/**
* @return Returns the order.
* @hibernate.property column = "FOLDER_ORDER" not-null = "true"
*/
public int getOrder() {
return order;
}
/**
* @param order The order to set.
*/
public void setOrder(int order) {
this.order = order;
}
}
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
/*
* This file is part of Tidia-Ae Project.
*
* Tidia-Ae Project is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tidia-Ae Project is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tidia-Ae Project; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package br.fapesp.tidia.ae.common.commontypes.vo;
import java.io.Serializable;
public abstract class ObjectVO implements Serializable {
protected Long id;
/**
* @param identifier
*/
public ObjectVO(Long identifier) {
this();
this.id = identifier;
}
/**
*
*/
public ObjectVO() {
super();
}
/**
* @return Returns the id.
*
* @hibernate.id column="id" generator-class="native"
*/
public Long getId() {
return id;
}
/**
* @param newId
* The id to set.
*/
public void setId(Long newId) {
this.id = newId;
}
public int hashCode() {
return id.intValue();
}
}
|