bradford
unread,Mar 29, 2009, 2:23:17 PM3/29/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lift
I have two models in separate .scala files. One of them is a
ForeignKey to the other. The problem I'm having is that it won't let
me import the Foreign model, since I have not defined a companion
object. And if I do define a companion object, I get a NetBeans
warning saying, "imported `Courses` is permanently hidden by
definition of object Courses in package model.
What do I need to change?
=== Courses.scala ===
package com.n.hello.model
import _root_.net.liftweb.mapper._
class Courses extends KeyedMapper[Long, Courses] {
def primaryKeyField = id
object id extends MappedLongIndex(this)
object name extends MappedString(this, 25)
}
object Courses extends Courses with KeyedMetaMapper[Long, Courses] {
}
=== Teachers.scala ===
package com.n.hello.model
import _root_.net.liftweb.mapper._
// import model.Courses // <-- problem if I add this line w/ or w/out
companion object defined in Courses
class Teachers extends KeyedMapper[String, Teachers] {
def primaryKeyField = nick
object nick extends MappedStringIndex(this, 10)
object course_id extends MappedLongForeignKey(this, Courses)
}