Skip to content
Snippets Groups Projects
Commit a1bcf7f8 authored by tjc's avatar tjc
Browse files

add option to read children of a feature from the database

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@6772 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 39530123
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,9 @@ public class DatabaseDocument extends Document
private boolean gene_builder;
// include children in reading from the database
private boolean readChildren = true;
private Range range;
private Feature geneFeature;
......@@ -339,6 +342,11 @@ public class DatabaseDocument extends Document
catch(Exception e) {}
}
public void setReadChildren(final boolean readChildren)
{
this.readChildren = readChildren;
}
/**
* Reset the schema.
* @param location
......@@ -459,7 +467,7 @@ public class DatabaseDocument extends Document
schemaList.add(schema);
ByteBuffer bb = getGeneFeature(srcFeatureId,
schemaList, dao);
schemaList, dao, readChildren);
return new ByteArrayInputStream(bb.getBytes());
}
else if(range != null)
......@@ -902,7 +910,8 @@ public class DatabaseDocument extends Document
*/
private ByteBuffer getGeneFeature(final String search_gene,
final List schema_search,
GmodDAO dao)
GmodDAO dao,
final boolean readChildren)
throws SQLException, ReadFormatException, ConnectException
{
if(DatabaseDocument.cvterms == null)
......@@ -954,6 +963,12 @@ public class DatabaseDocument extends Document
id_store, parent.getUniqueName(), src_id, buff, chadoFeature);
if(!readChildren)
{
logger4j.debug( new String(buff.getBytes()) );
return buff;
}
// get children of gene
List relations = new Vector(chadoFeature.getFeatureRelationshipsForObjectId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment