From: <rv...@us...> - 2010-06-01 20:05:39
|
Revision: 702 http://treebase.svn.sourceforge.net/treebase/?rev=702&view=rev Author: rvos Date: 2010-06-01 20:05:30 +0000 (Tue, 01 Jun 2010) Log Message: ----------- Fixes for issue 2974771, ELException when getting phyloWSPath of the context object that defines the focal object (e.g. the containing study). This is addressed by adding the @Fetch(FetchMode.JOIN) annotation. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixColumn.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixElement.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixColumn.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixColumn.java 2010-06-01 17:11:18 UTC (rev 701) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixColumn.java 2010-06-01 20:05:30 UTC (rev 702) @@ -18,6 +18,8 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.Index; import org.cipres.treebase.domain.AbstractPersistedObject; @@ -78,6 +80,7 @@ // the nullable = false cause the add error code -407, the matrix column is null! // @JoinColumn(name = "MATRIX_ID", insertable = false, updatable = false, nullable = false) @Index(name = "COLUMN_M_IDX") + @Fetch(FetchMode.JOIN) public CharacterMatrix getMatrix() { return mMatrix; } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixElement.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixElement.java 2010-06-01 17:11:18 UTC (rev 701) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixElement.java 2010-06-01 20:05:30 UTC (rev 702) @@ -20,6 +20,8 @@ import javax.persistence.Transient; import org.hibernate.annotations.BatchSize; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.Index; import org.cipres.treebase.domain.AbstractPersistedObject; @@ -119,6 +121,7 @@ @ManyToOne @JoinColumn(name = "MATRIXCOLUMN_ID", nullable = true) @Index(name = "Element_COL_IDX") + @Fetch(FetchMode.JOIN) public MatrixColumn getColumn() { return mColumn; } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-06-01 17:11:18 UTC (rev 701) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-06-01 20:05:30 UTC (rev 702) @@ -458,6 +458,7 @@ */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "STUDY_ID") + @Fetch(FetchMode.JOIN) public Study getStudy() { return mStudy; } @@ -813,6 +814,7 @@ @Override @Transient public Study getContext() { + // org.hibernate.LazyInitializationException return getStudy(); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java 2010-06-01 17:11:18 UTC (rev 701) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java 2010-06-01 20:05:30 UTC (rev 702) @@ -17,6 +17,8 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.Index; import org.cipres.treebase.TreebaseUtil; @@ -168,6 +170,7 @@ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PHYLOTREE_ID", nullable = false) @Index(name = "TNODE_TREE_IDX") + @Fetch(FetchMode.JOIN) public PhyloTree getTree() { return mTree; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |