Hi,

Just spend a few hours tracing down an issue with mapped objects.

Background:

I have trait that I mixin to several Mapper objects to always record the
owner of an entity:

trait OwnedEntity {
  self: BaseMapper =>

  object account extends MappedLongForeignKey(this.asInstanceOf[MapperType], 
Account) {
    override def dbColumnName = "account_id"
    override def dbDisplay_? = false
    override def defaultValue = Account.currentAccountId_!
  }
}

this used to work fine. I've been doing a lot of refactoring to my
mapped objects and suddenly I got a NULL error for this field. Long
story short, it turned out I changed currentAccountId_! to redirect to
an error page if no account is present.

But apparently, a number of instances of the mapped objects are created
during Boot. This fails silently with the above change and the
"account_id" field is never included in any Mapper sql statements.

Could we add a Log.warn statement in this case?

/Jeppe

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.


Reply via email to