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)
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---