|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
CRUDify view pages not working correctlyI have recently started using Lift (1.1-M6) to create a simple data editing application. I have a small table with a char(1) key column (on which I set dbDisplay_? to true) and a name column for which I created mapper code following the sample in the Exploring Lift book. When my app displays the View page, the key column shows a value but the name column is blank for all records. The key field values are not in sorted order, and when I click on a View link it displays a page with a key value that is different from the key in the link. Each time I click the link I get a different result. Some of the links refer to keys that don't exist, and when I click on one of those I get a message that the page is not in the SiteMap and is thus blocked. Some links appear multiple times on different rows. I am trying to figure out how I go about debugging this behavior. I have called DB.addLogFunc so that I can see what SQL has been executed. The query for the list of records includes an ORDER BY clause and what I can see looks good. When I execute that query in my DB browser I get the expected results, properly sorted. Are there any other debugging hooks I can set? Is there a simple way I can get it to print out the values it is pulling from the database? Any other suggestions? -- Jim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@... To unsubscribe from this group, send email to liftweb+unsubscribe@... For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
|
|
|
Re: CRUDify view pages not working correctlyI have not added anything that seems unusual to me. My code looks just like what I have listed below except for the table and column names. I am putting "Foo.menus" into another menu in the SiteMap, that part seems to be working properly. I have some other tables that reference this one as a foreign key, but I don't expect that should have any affect on viewing this table. class Foo extends KeyedMapper[String,Foo] { def getSingleton = Foo def primaryKeyField = foo_key object foo_key extends MappedStringIndex(this,1) { override def dbColumnName = "FOO_KK" override def dbDisplay_? = true } object name extends MappedString(this,50) { override def dbColumnName = "FOO_NM" } } object Foo extends Foo with KeyedMetaMapper[String,Foo] with CRUDify[String,Foo] { def byKey(key:String) = Foo.findAll(By(Foo.foo_key, key)) override def dbTableName = "FOO_T" override def createMenuName = "Create Foo" override def editMenuName = "Edit Foo" override def showAllMenuName = "List Foos" override def viewMenuName = "View Foo" } -- Jim On Mon, Nov 02, 2009 at 05:21:32PM -0800, Naftoli Gugenheim wrote: > Date: Mon, 2 Nov 2009 17:21:32 -0800 (PST) > From: Naftoli Gugenheim <naftoligug@...> > To: liftweb@... > Subject: [Lift] Re: CRUDify view pages not working correctly > > > This is pure out-of-the-box CRUDify? No custom binding/querying? > > ------------------------------------- > Jim McBeath<google@...> wrote: > > > I have recently started using Lift (1.1-M6) to create a simple data > editing application. I have a small table with a char(1) key column > (on which I set dbDisplay_? to true) and a name column for which I > created mapper code following the sample in the Exploring Lift book. > When my app displays the View page, the key column shows a value but > the name column is blank for all records. The key field values are > not in sorted order, and when I click on a View link it displays a > page with a key value that is different from the key in the link. Each > time I click the link I get a different result. Some of the links > refer to keys that don't exist, and when I click on one of those I get > a message that the page is not in the SiteMap and is thus blocked. > Some links appear multiple times on different rows. > > I am trying to figure out how I go about debugging this behavior. I > have called DB.addLogFunc so that I can see what SQL has been > executed. The query for the list of records includes an ORDER BY > clause and what I can see looks good. When I execute that query in my > DB browser I get the expected results, properly sorted. Are there any > other debugging hooks I can set? Is there a simple way I can get it > to print out the values it is pulling from the database? Any other > suggestions? > > -- > Jim > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@... To unsubscribe from this group, send email to liftweb+unsubscribe@... For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: CRUDify view pages not working correctlyWhat database are you using? MySQL? H2? Other
Please try again with 1.1-SNAPSHOT or wait until tomorrow (Nov 4th) when 1.1-M7 is released. David fixed some things in Mapper just yesterday (issue # 151) related to uppercase dbTableName and dbColumnName to remedy a similar Mapper problem we were seeing with MySQL & H2 databases, and I believe these fixes are included in 1.1-M7 release. I know for sure it is working in 1.1-SNAPSHOT as we put the new Mapper fixes through their paces today with great success. Thanks, Troy On Tue, Nov 3, 2009 at 8:34 AM, Jim McBeath <google@...> wrote:
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@... To unsubscribe from this group, send email to liftweb+unsubscribe@... For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: CRUDify view pages not working correctlyThis is on MySQL. I see the same behavior on Oracle. My key column is a CHAR column rather than VARCHAR. I noticed that some places in the code check for VARCHAR and CHAR types, whereas some only check for VARCHAR. I tried hacking the code to add CHAR in those places, but that did not make any difference. I will try 1.1-M7 and see how things work on that version. -- Jim On Tue, Nov 03, 2009 at 06:42:07PM -0700, Troy Noble wrote: > Date: Tue, 3 Nov 2009 18:42:07 -0700 > From: Troy Noble <econoplas@...> > To: liftweb@... > Subject: [Lift] Re: CRUDify view pages not working correctly > > What database are you using? MySQL? H2? Other > Please try again with 1.1-SNAPSHOT or wait until tomorrow (Nov 4th) > when 1.1-M7 is released. > David fixed some things in Mapper just yesterday (issue # 151) related > to uppercase dbTableName and dbColumnName to remedy a similar Mapper > problem we were seeing with MySQL & H2 databases, and I believe these > fixes are included in 1.1-M7 release. I know for sure it is working in > 1.1-SNAPSHOT as we put the new Mapper fixes through their paces today > with great success. > Thanks, Troy > > On Tue, Nov 3, 2009 at 8:34 AM, Jim McBeath <google@...> wrote: > > I have not added anything that seems unusual to me. My code looks > just like what I have listed below except for the table and column > names. I am putting "Foo.menus" into another menu in the SiteMap, > that part seems to be working properly. I have some other tables > that reference this one as a foreign key, but I don't expect that > should have any affect on viewing this table. > class Foo extends KeyedMapper[String,Foo] { > def getSingleton = Foo > def primaryKeyField = foo_key > object foo_key extends MappedStringIndex(this,1) { > override def dbColumnName = "FOO_KK" > override def dbDisplay_? = true > } > object name extends MappedString(this,50) { > override def dbColumnName = "FOO_NM" > } > } > object Foo extends Foo > with KeyedMetaMapper[String,Foo] > with CRUDify[String,Foo] { > def byKey(key:String) = Foo.findAll(By(Foo.foo_key, key)) > override def dbTableName = "FOO_T" > override def createMenuName = "Create Foo" > override def editMenuName = "Edit Foo" > override def showAllMenuName = "List Foos" > override def viewMenuName = "View Foo" > } > -- > Jim > On Mon, Nov 02, 2009 at 05:21:32PM -0800, Naftoli Gugenheim wrote: > > Date: Mon, 2 Nov 2009 17:21:32 -0800 (PST) > > From: Naftoli Gugenheim <naftoligug@...> > > To: liftweb@... > > Subject: [Lift] Re: CRUDify view pages not working correctly > > > > > > This is pure out-of-the-box CRUDify? No custom binding/querying? > > > > ------------------------------------- > > Jim McBeath<google@...> wrote: > > > > > > I have recently started using Lift (1.1-M6) to create a simple > data > > editing application. I have a small table with a char(1) key > column > > (on which I set dbDisplay_? to true) and a name column for which I > > created mapper code following the sample in the Exploring Lift > book. > > When my app displays the View page, the key column shows a value > but > > the name column is blank for all records. The key field values > are > > not in sorted order, and when I click on a View link it displays a > > page with a key value that is different from the key in the link. > Each > > time I click the link I get a different result. Some of the links > > refer to keys that don't exist, and when I click on one of those I > get > > a message that the page is not in the SiteMap and is thus blocked. > > Some links appear multiple times on different rows. > > > > I am trying to figure out how I go about debugging this behavior. > I > > have called DB.addLogFunc so that I can see what SQL has been > > executed. The query for the list of records includes an ORDER BY > > clause and what I can see looks good. When I execute that query > in my > > DB browser I get the expected results, properly sorted. Are there > any > > other debugging hooks I can set? Is there a simple way I can get > it > > to print out the values it is pulling from the database? Any other > > suggestions? > > > > -- > > Jim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@... To unsubscribe from this group, send email to liftweb+unsubscribe@... For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: CRUDify view pages not working correctlyWorks in M7. Thanks for the fix. I had to tweak Driver.scala and set brokenLimit_? = true in OracleDriver to make it work under Oracle, since Oracle does not support LIMIT and OFFSET. I was getting a traceback from the Oracle JDBC driver complaining about bad SQL. Unfortunately, since my DB logger function (set by a call to DB.addLogFunc) is only called after the SQL completes, I was unable to see the SQL that was causing the traceback, and had to hack in some print statements to see why it was failing. It would be nice to have an error logging callback that would be called when an exception is caught during execution of an SQL request, with simiilar info to the current callback except it would get an Exception rather than an execution time. -- Jim On Tue, Nov 03, 2009 at 06:48:01PM -0800, Jim McBeath wrote: > Date: Tue, 3 Nov 2009 18:48:01 -0800 > From: Jim McBeath <google@...> > To: liftweb@... > Subject: [Lift] Re: CRUDify view pages not working correctly > > > This is on MySQL. I see the same behavior on Oracle. > > My key column is a CHAR column rather than VARCHAR. I noticed > that some places in the code check for VARCHAR and CHAR types, > whereas some only check for VARCHAR. I tried hacking the code to > add CHAR in those places, but that did not make any difference. > > I will try 1.1-M7 and see how things work on that version. > > -- > Jim > > On Tue, Nov 03, 2009 at 06:42:07PM -0700, Troy Noble wrote: > > Date: Tue, 3 Nov 2009 18:42:07 -0700 > > From: Troy Noble <econoplas@...> > > To: liftweb@... > > Subject: [Lift] Re: CRUDify view pages not working correctly > > > > What database are you using? MySQL? H2? Other > > Please try again with 1.1-SNAPSHOT or wait until tomorrow (Nov 4th) > > when 1.1-M7 is released. > > David fixed some things in Mapper just yesterday (issue # 151) related > > to uppercase dbTableName and dbColumnName to remedy a similar Mapper > > problem we were seeing with MySQL & H2 databases, and I believe these > > fixes are included in 1.1-M7 release. I know for sure it is working in > > 1.1-SNAPSHOT as we put the new Mapper fixes through their paces today > > with great success. > > Thanks, Troy > > > > On Tue, Nov 3, 2009 at 8:34 AM, Jim McBeath <google@...> wrote: > > > > I have not added anything that seems unusual to me. My code looks > > just like what I have listed below except for the table and column > > names. I am putting "Foo.menus" into another menu in the SiteMap, > > that part seems to be working properly. I have some other tables > > that reference this one as a foreign key, but I don't expect that > > should have any affect on viewing this table. > > class Foo extends KeyedMapper[String,Foo] { > > def getSingleton = Foo > > def primaryKeyField = foo_key > > object foo_key extends MappedStringIndex(this,1) { > > override def dbColumnName = "FOO_KK" > > override def dbDisplay_? = true > > } > > object name extends MappedString(this,50) { > > override def dbColumnName = "FOO_NM" > > } > > } > > object Foo extends Foo > > with KeyedMetaMapper[String,Foo] > > with CRUDify[String,Foo] { > > def byKey(key:String) = Foo.findAll(By(Foo.foo_key, key)) > > override def dbTableName = "FOO_T" > > override def createMenuName = "Create Foo" > > override def editMenuName = "Edit Foo" > > override def showAllMenuName = "List Foos" > > override def viewMenuName = "View Foo" > > } > > -- > > Jim > > On Mon, Nov 02, 2009 at 05:21:32PM -0800, Naftoli Gugenheim wrote: > > > Date: Mon, 2 Nov 2009 17:21:32 -0800 (PST) > > > From: Naftoli Gugenheim <naftoligug@...> > > > To: liftweb@... > > > Subject: [Lift] Re: CRUDify view pages not working correctly > > > > > > > > > This is pure out-of-the-box CRUDify? No custom binding/querying? > > > > > > ------------------------------------- > > > Jim McBeath<google@...> wrote: > > > > > > > > > I have recently started using Lift (1.1-M6) to create a simple > > data > > > editing application. I have a small table with a char(1) key > > column > > > (on which I set dbDisplay_? to true) and a name column for which I > > > created mapper code following the sample in the Exploring Lift > > book. > > > When my app displays the View page, the key column shows a value > > but > > > the name column is blank for all records. The key field values > > are > > > not in sorted order, and when I click on a View link it displays a > > > page with a key value that is different from the key in the link. > > Each > > > time I click the link I get a different result. Some of the links > > > refer to keys that don't exist, and when I click on one of those I > > get > > > a message that the page is not in the SiteMap and is thus blocked. > > > Some links appear multiple times on different rows. > > > > > > I am trying to figure out how I go about debugging this behavior. > > I > > > have called DB.addLogFunc so that I can see what SQL has been > > > executed. The query for the list of records includes an ORDER BY > > > clause and what I can see looks good. When I execute that query > > in my > > > DB browser I get the expected results, properly sorted. Are there > > any > > > other debugging hooks I can set? Is there a simple way I can get > > it > > > to print out the values it is pulling from the database? Any other > > > suggestions? > > > > > > -- > > > Jim > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@... To unsubscribe from this group, send email to liftweb+unsubscribe@... For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |