[Lift] Re: Wiki One-to-Many
Thank you for your help. On Nov 16, 9:15 am, Naftoli Gugenheim wrote: > Copy-paste error. Your Book.sort is inside Book.name. > > - > > Randinn wrote: > > Ah, I thought that it would be less of a bother so people wouldn't > have to deal with my trivial questions. Here it is > > import net.liftweb.util._ > import net.liftweb.http._ > import net.liftweb.mapper._ > > object Author extends Author with LongKeyedMetaMapper[Author] > class Author extends LongKeyedMapper[Author] with IdPK with OneToMany > [Long, Author] { > def getSingleton = Author > object name extends MappedString(this, 100) > object books extends MappedOneToMany(Book, Book.author, OrderBy > (Book.sort, Ascending)) with Owned[Book] with Cascade[Book]} > > object Book extends Book with LongKeyedMetaMapper[Book] > > class Book extends LongKeyedMapper[Book] with IdPK with Ordered[Book] > { > def getSingleton = Book > object author extends MappedLongForeignKey(this, Author) > with LongMappedForeignMapper[Book, Author] > object name extends MappedString(this, 100) { > object sort extends MappedInt(this) > def compare(that: Book) = this.sort.is - that.sort.is > } > > } > > Here is the errors > > C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala > \onetwomany\model\Author.scala:18: > error: value sort is not a member of object many.model.Book > object books extends MappedOneToMany(Book, Book.author, OrderBy > (Book.sort, Ascending)) with Owned[ > Book] with Cascade[Book] > > ^ > C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala > \onetwomany\model\Author.scala:18: > error: wrong number of arguments for constructor Object: () > java.lang.Object > object books extends MappedOneToMany(Book, Book.author, OrderBy > (Book.sort, Ascending)) with Owned[ > Book] with Cascade[Book] > ^ > C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala > \onetwomany\model\Author.scala:27: > error: inferred type arguments [object Book.this.name] do not conform > to class MappedInt's type par > ameter bounds [T <: net.liftweb.mapper.Mapper[T]] > object sort extends MappedInt(this) > ^ > C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala > \onetwomany\model\Author.scala:28: > error: value sort is not a member of many.model.Book > def compare(that: Book) = this.sort.is - that.sort.is > ^ > C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala > \onetwomany\snippet\EditOne.scala: > 16: error: value SHtml is not a member of package net.liftweb > import net.liftweb.SHtml._ > ^ > C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala > \onetwomany\snippet\ListOne.scala: > 23: error: not found: value link > "edit" -> link("edit", ()=>author=a, Text(?("Edit"))), > ^ > 6 errors found > > I first tried to separate Author and Books into their own classes and > when I was not able to get it to work I Just "cut and paste" the > example into one class. > > On Nov 16, 1:06 am, Naftoli Gugenheim wrote: > > > Why don't you try the reverse -- post your code and error? > > > - > > > Randinn wrote: > > > I was wondering if anyone that read the Git wiki One-to-Many made the > > example could post it onto Github as i was unsuccessful. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Wiki One-to-Many
Copy-paste error. Your Book.sort is inside Book.name. - Randinn wrote: Ah, I thought that it would be less of a bother so people wouldn't have to deal with my trivial questions. Here it is import net.liftweb.util._ import net.liftweb.http._ import net.liftweb.mapper._ object Author extends Author with LongKeyedMetaMapper[Author] class Author extends LongKeyedMapper[Author] with IdPK with OneToMany [Long, Author] { def getSingleton = Author object name extends MappedString(this, 100) object books extends MappedOneToMany(Book, Book.author, OrderBy (Book.sort, Ascending)) with Owned[Book] with Cascade[Book] } object Book extends Book with LongKeyedMetaMapper[Book] class Book extends LongKeyedMapper[Book] with IdPK with Ordered[Book] { def getSingleton = Book object author extends MappedLongForeignKey(this, Author) with LongMappedForeignMapper[Book, Author] object name extends MappedString(this, 100) { object sort extends MappedInt(this) def compare(that: Book) = this.sort.is - that.sort.is } } Here is the errors C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:18: error: value sort is not a member of object many.model.Book object books extends MappedOneToMany(Book, Book.author, OrderBy (Book.sort, Ascending)) with Owned[ Book] with Cascade[Book] ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:18: error: wrong number of arguments for constructor Object: () java.lang.Object object books extends MappedOneToMany(Book, Book.author, OrderBy (Book.sort, Ascending)) with Owned[ Book] with Cascade[Book] ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:27: error: inferred type arguments [object Book.this.name] do not conform to class MappedInt's type par ameter bounds [T <: net.liftweb.mapper.Mapper[T]] object sort extends MappedInt(this) ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:28: error: value sort is not a member of many.model.Book def compare(that: Book) = this.sort.is - that.sort.is ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\snippet\EditOne.scala: 16: error: value SHtml is not a member of package net.liftweb import net.liftweb.SHtml._ ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\snippet\ListOne.scala: 23: error: not found: value link "edit" -> link("edit", ()=>author=a, Text(?("Edit"))), ^ 6 errors found I first tried to separate Author and Books into their own classes and when I was not able to get it to work I Just "cut and paste" the example into one class. On Nov 16, 1:06 am, Naftoli Gugenheim wrote: > Why don't you try the reverse -- post your code and error? > > - > > Randinn wrote: > > I was wondering if anyone that read the Git wiki One-to-Many made the > example could post it onto Github as i was unsuccessful. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Wiki One-to-Many
Ah, I thought that it would be less of a bother so people wouldn't have to deal with my trivial questions. Here it is import net.liftweb.util._ import net.liftweb.http._ import net.liftweb.mapper._ object Author extends Author with LongKeyedMetaMapper[Author] class Author extends LongKeyedMapper[Author] with IdPK with OneToMany [Long, Author] { def getSingleton = Author object name extends MappedString(this, 100) object books extends MappedOneToMany(Book, Book.author, OrderBy (Book.sort, Ascending)) with Owned[Book] with Cascade[Book] } object Book extends Book with LongKeyedMetaMapper[Book] class Book extends LongKeyedMapper[Book] with IdPK with Ordered[Book] { def getSingleton = Book object author extends MappedLongForeignKey(this, Author) with LongMappedForeignMapper[Book, Author] object name extends MappedString(this, 100) { object sort extends MappedInt(this) def compare(that: Book) = this.sort.is - that.sort.is } } Here is the errors C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:18: error: value sort is not a member of object many.model.Book object books extends MappedOneToMany(Book, Book.author, OrderBy (Book.sort, Ascending)) with Owned[ Book] with Cascade[Book] ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:18: error: wrong number of arguments for constructor Object: () java.lang.Object object books extends MappedOneToMany(Book, Book.author, OrderBy (Book.sort, Ascending)) with Owned[ Book] with Cascade[Book] ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:27: error: inferred type arguments [object Book.this.name] do not conform to class MappedInt's type par ameter bounds [T <: net.liftweb.mapper.Mapper[T]] object sort extends MappedInt(this) ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\model\Author.scala:28: error: value sort is not a member of many.model.Book def compare(that: Book) = this.sort.is - that.sort.is ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\snippet\EditOne.scala: 16: error: value SHtml is not a member of package net.liftweb import net.liftweb.SHtml._ ^ C:\Users\Randin\Documents\Scala\one2many\onetwomany\src\main\scala \onetwomany\snippet\ListOne.scala: 23: error: not found: value link "edit" -> link("edit", ()=>author=a, Text(?("Edit"))), ^ 6 errors found I first tried to separate Author and Books into their own classes and when I was not able to get it to work I Just "cut and paste" the example into one class. On Nov 16, 1:06 am, Naftoli Gugenheim wrote: > Why don't you try the reverse -- post your code and error? > > - > > Randinn wrote: > > I was wondering if anyone that read the Git wiki One-to-Many made the > example could post it onto Github as i was unsuccessful. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Wiki One-to-Many
Why don't you try the reverse -- post your code and error? - Randinn wrote: I was wondering if anyone that read the Git wiki One-to-Many made the example could post it onto Github as i was unsuccessful. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---