On Fri, Dec 11, 2009 at 5:58 AM, Jeppe Nejsum Madsen <je...@ingolfs.dk>wrote:

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

What is the case that we should be testing for?


>
> /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<liftweb%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

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