Hi,

During my journey through the lift source code & examples I was
wondering the following:

you have  a simple mapped class User

class Person extends LongKeyedMapper[Person] with IdPK {
 def getSingleton = Person

 object firstName extends MappedString(this, 100)
 object lastName  extends MappedString(this, 100)


I was wondering why firstName and lastName was an object. I also tried
changing it to a val (just wondering what the result would be)
so:

 val firstName = new MappedString(this,100)

This compiled without a problem, however at runtime, this would throw
an exception.

Exception occured while processing /database

Message: java.lang.NullPointerException
        net.liftweb.mapper.MappedField$class.dbColumnName(MappedField.scala:
516)
        net.liftweb.mapper.MappedString.dbColumnName(MappedString.scala:38)
        net.liftweb.mapper.MetaMapper$$anonfun$_addOrdering$1.apply
(MetaMapper.scala:455)
        net.liftweb.mapper.MetaMapper$$anonfun$_addOrdering$1.apply
(MetaMapper.scala:454)
        scala.List.flatMap(List.scala:1132)
        net.liftweb.mapper.MetaMapper$class._addOrdering(MetaMapper.scala:
454)
        net.liftweb.mapper.MetaMapper$class.addEndStuffs(MetaMapper.scala:
465)
        net.liftweb.example.model.Person$.addEndStuffs(Person.scala:22)


I have 2 questions:

1. why did the val firstName not work?
2. if this is prohibited, why is the MappedString class not abstract
or a trait?


Best regards,


Jo


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

Reply via email to