Question

I am using JDK 1.6.0_16, and Scala 2.7.7, compiling with maven.

I do mvn clean compile and I get four errors, but they are identical, in different models:

[ERROR] C:\Users\owner\workspace\ResumeApp\src\main\scala\jblack\resumeapp\lift\ model\ContactInfoModel.scala:13: error: illegal inheritance;

[INFO] self-type jblack.resumeapp.lift.model.ContactInfoModel does not conform to net.liftweb.mapper.CRUDify[Long,jblack.resumeapp.lift.model.ContactInfoModel] 's selftype net.liftweb.mapper.CRUDify[Long,jblack.resumeapp.lift.model.ContactI nfoModel] with jblack.resumeapp.lift.model.ContactInfoModel with net.liftweb.map per.KeyedMetaMapper[Long,jblack.resumeapp.lift.model.ContactInfoModel]

[INFO] with CRUDify[Long, ContactInfoModel] {

And this is my code:

package jblack.resumeapp.lift.model

import net.liftweb.mapper._

object ContactInfoMetaData 
    extends ContactInfoModel 
        with KeyedMetaMapper[Long, ContactInfoModel] {
    override def dbTableName = "contactinfo"
    override def fieldOrder = List(key, data, display) 
}
class ContactInfoModel 
    extends KeyedMapper[Long, ContactInfoModel] 
        with CRUDify[Long, ContactInfoModel] {
    def getSingleton = ContactInfoMetaData
    def primaryKeyField = id

    object id extends MappedLongIndex(this)
    object key extends MappedString(this, 100)
    object data extends MappedString(this, 100)
    object display extends MappedBoolean(this)
}

I am not certain what I am doing wrong.

Unfortunately, because I installed the nightly plugin, into Eclipse, I can't install IDE 2.7.7, so I can only compile this with maven.

Is there a problem with how I am using CRUDify?

Was it helpful?

Solution

CRUDify in lift-1.1 needs to be mixed into the MetaMapper object instead of the Mapper class. So it should work with this code instead:

package jblack.resumeapp.lift.model

import net.liftweb.mapper._

object ContactInfoMetaData 
    extends ContactInfoModel 
        with KeyedMetaMapper[Long, ContactInfoModel]
        with CRUDify[Long, ContactInfoModel] {
    override def dbTableName = "contactinfo"
    override def fieldOrder = List(key, data, display) 
}
class ContactInfoModel 
    extends KeyedMapper[Long, ContactInfoModel] {
    def getSingleton = ContactInfoMetaData
    def primaryKeyField = id

    object id extends MappedLongIndex(this)
    object key extends MappedString(this, 100)
    object data extends MappedString(this, 100)
    object display extends MappedBoolean(this)
}

OTHER TIPS

I finally got it working properly when I went back to using LIFT 1.0 instead of 1.1. It appears that there is some change that I need to eventually look into for 1.1, but at least I can continue with my development.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top