From 030c728cd18e09460c7ca6091da8345b93a38469 Mon Sep 17 00:00:00 2001
From: tjc <tjc@ee4ac58c-ac51-4696-9907-e4b3aa274f04>
Date: Tue, 14 Jun 2005 10:21:26 +0000
Subject: [PATCH] use debug property flag

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@2848 ee4ac58c-ac51-4696-9907-e4b3aa274f04
---
 uk/ac/sanger/artemis/util/DatabaseDocument.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/uk/ac/sanger/artemis/util/DatabaseDocument.java b/uk/ac/sanger/artemis/util/DatabaseDocument.java
index 3c0b03b82..9bb680b90 100644
--- a/uk/ac/sanger/artemis/util/DatabaseDocument.java
+++ b/uk/ac/sanger/artemis/util/DatabaseDocument.java
@@ -193,11 +193,11 @@ public class DatabaseDocument extends Document
           throws java.sql.SQLException
   {
     Statement st = conn.createStatement();
-    String sql = "SELECT strand, fmin, fmax, value, uniquename, feature.type_id, featureprop.type_id, strand"+
+    String sql = "SELECT strand, fmin, fmax, value, uniquename, feature.type_id, featureprop.type_id AS prop_type_id, strand"+
                  " FROM feature, featureloc, featureprop WHERE srcfeature_id = "+parentFeatureID+
                  " and featureloc.feature_id=featureprop.feature_id"+
-                 " and featureloc.feature_id=feature.feature_id" +
-                 " and feature.type_id=cvterm.cvterm_id"; // and cvterm.name='gene'";
+                 " and featureloc.feature_id=feature.feature_id";
+//                 " and feature.type_id=cvterm.cvterm_id"; // and cvterm.name='gene'";
 
     appendToLogFile(sql,sqlLog);
     ResultSet rs = st.executeQuery(sql);
@@ -210,8 +210,8 @@ public class DatabaseDocument extends Document
     {
       int fmin          = rs.getInt("fmin")+1;
       int fmax          = rs.getInt("fmax");
-      long type_id      = rs.getLong(6);
-      long prop_type_id = rs.getLong(7);
+      long type_id      = rs.getLong("type_id");
+      long prop_type_id = rs.getLong("prop_type_id");
       int strand      = rs.getInt("strand");
       String name     = rs.getString("uniquename");
       String typeName = getCvtermName(conn,type_id);
@@ -393,6 +393,9 @@ public class DatabaseDocument extends Document
   */
   private void appendToLogFile(String logEntry, String logFileName)
   {
+    if(System.getProperty("debug") == null)
+      return;
+
     BufferedWriter bw = null;
     try
     {
-- 
GitLab