I'm working on some Mapper stuff right now and one thing I miss is true foreign key mapping with constraints and cascades. My gut is that we should be able to add this for DBs that support it, but do you see any issues with the concept?
Derek On Fri, Feb 20, 2009 at 12:41 PM, David Pollak < [email protected]> wrote: > In your meta mapper, if you override dbAddTable to return Full[() => Unit], > that function will be called after all the modifications have been made to > the tables, if your table was added as part of Schemifier's changes. > > On Fri, Feb 20, 2009 at 9:18 AM, DavidV <[email protected]>wrote: > >> >> I wondering how to populate rows of a DB table upon it's creation. >> First, where in the lift code are tables created? Is it in trait >> BaseMapper's dbAddTable method? I have an Array[String] I would like >> to add to the table when it is being created. Which method can I >> override to achieve this and how should I do so? > > > You'd probably do something like: > > object MyTable extends MyTable with MetaMapper[MyTable] { > private val myArray = Array("foo", "bar") > private val writeToNewTable() { > for (s <- myArray) { > create.columnForString(s).save > } > } > > override def dbAddTable = Full(writeToNewTable _) > } > > Does this help? > > Thanks, > > David > > >> >> >> Thanks! >> -David >> >> >> > > > -- > Lift, the simply functional web framework http://liftweb.net > Beginning Scala http://www.apress.com/book/view/1430219890 > Follow me: http://twitter.com/dpp > Git some: http://github.com/dpp > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
