[rhmessaging-commits] rhmessaging commits: r3845 - in mgmt/trunk/rosemary: python/rosemary and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Feb 5 15:22:38 EST 2010


Author: justi9
Date: 2010-02-05 15:22:38 -0500 (Fri, 05 Feb 2010)
New Revision: 3845

Modified:
   mgmt/trunk/rosemary/bin/rosemary-test
   mgmt/trunk/rosemary/python/rosemary/model.py
   mgmt/trunk/rosemary/python/rosemary/sqloperation.py
Log:
Fix test tool and sql item operations

Modified: mgmt/trunk/rosemary/bin/rosemary-test
===================================================================
--- mgmt/trunk/rosemary/bin/rosemary-test	2010-02-05 20:08:12 UTC (rev 3844)
+++ mgmt/trunk/rosemary/bin/rosemary-test	2010-02-05 20:22:38 UTC (rev 3845)
@@ -10,11 +10,14 @@
         for cls in package.classes:
             print "  class %s" % cls.name
 
+            for ref in cls.references:
+                print "    ref %s %s" % (ref.name, ref.title or "")
+
             for prop in cls.properties:
                 print "    prop %s %s" % (prop.name, prop.title or "")
 
             for stat in cls.statistics:
-                print "    stat %s" % stat.name
+                print "    stat %s %s" % (stat.name, stat.title or "")
 
             for meth in cls.methods:
                 print "    meth %s" % meth.name
@@ -54,14 +57,14 @@
 
     query = SqlQuery(table)
 
-    stats_col = stats_table.columns_by_name["parent_id"]
+    stats_col = stats_table.columns_by_name["_parent_id"]
 
-    SqlOuterJoin(query, table.id_column, stats_col)
-    SqlInnerJoin(query, table.id_column, vhost_table.id_column)
+    SqlOuterJoin(query, table.key_column, stats_col)
+    SqlInnerJoin(query, table.key_column, vhost_table.key_column)
 
-    broker_col = vhost_table.columns_by_name["brokerRef"]
+    broker_col = vhost_table.columns_by_name["_brokerRef_id"]
 
-    SqlInnerJoin(query, broker_col, broker_table.id_column)
+    SqlInnerJoin(query, broker_col, broker_table.key_column)
 
     cols = table.columns + vhost_table.columns + broker_table.columns + \
         stats_table.columns

Modified: mgmt/trunk/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/trunk/rosemary/python/rosemary/model.py	2010-02-05 20:08:12 UTC (rev 3844)
+++ mgmt/trunk/rosemary/python/rosemary/model.py	2010-02-05 20:22:38 UTC (rev 3845)
@@ -134,13 +134,12 @@
             meth.extend(child)
 
     def init(self):
+        self.add_qmf_columns()
         self.add_id_columns()
 
         for ref in self.references:
             ref.init()
 
-        self.add_qmf_columns()
-
         for prop in self.properties:
             prop.init()
 

Modified: mgmt/trunk/rosemary/python/rosemary/sqloperation.py
===================================================================
--- mgmt/trunk/rosemary/python/rosemary/sqloperation.py	2010-02-05 20:08:12 UTC (rev 3844)
+++ mgmt/trunk/rosemary/python/rosemary/sqloperation.py	2010-02-05 20:22:38 UTC (rev 3845)
@@ -15,7 +15,7 @@
         cols = ", ".join([x.identifier for x in columns])
         args = (cols, self.table.identifier)
 
-        return "select %s from %s where id = %%(id)" % args
+        return "select %s from %s where _id = %%(id)" % args
 
 class SqlInsertItem(SqlOperation):
     def emit(self, columns):
@@ -32,11 +32,11 @@
         exprs = ", ".join(exprs)
         args = (self.table.identifier, exprs)
 
-        return "update %s set %s where id = %%(id)" % args
+        return "update %s set %s where _id = %%(id)" % args
 
 class SqlDeleteItem(SqlOperation):
     def emit(self, columns):
-        return "delete from %s where id = %%(id)" % self.table.identifier
+        return "delete from %s where _id = %%(id)" % self.table.identifier
 
 class SqlQuery(SqlOperation):
     def __init__(self, table):



More information about the rhmessaging-commits mailing list