I am extending MegaProtoUser so save is called by that when the form
is submitted.

See the below console transcript, which will hopefully answer your
questions:

scala> import com.liftcode.hello.model._
import com.liftcode.hello.model._

scala> var u = User.findAll.first
u: com.liftcode.hello.model.User = com.liftcode.hello.model.User=
{id=1,First Name=george,Last
Name=agnelli,[email protected],Locale=en_US,Time Zone=Europe/
London,Password=*******,Personal
Essay=,address=NULL,superuser=false,validated=true,uniqueid=F2HRGHTI5OQDKBYM1CYWR5O1T5CR2PRH}

scala> var a = u.getAddress
a: com.liftcode.hello.model.Address = com.liftcode.hello.model.Address=
{country=,id=-1,postcode=,line3=,line2=,line1=}

scala> a.line1("blah")
res0: com.liftcode.hello.model.Address =
com.liftcode.hello.model.Address=
{country=,id=-1,postcode=,line3=,line2=,line1=blah}

scala> u.save
INFO - com.liftcode.hello.model.Address=
{country=,id=5,postcode=,line3=,line2=,line1=blah}
INFO - com.liftcode.hello.model.Address=
{country=,id=5,postcode=,line3=,line2=,line1=blah}
res1: Boolean = true

scala> u.address.is
res2: Long = 5

scala> User.findAll.first
res3: com.liftcode.hello.model.User = com.liftcode.hello.model.User=
{id=1,First Name=george,Last
Name=agnelli,[email protected],Locale=en_US,Time Zone=Europe/
London,Password=*******,Personal
Essay=,address=NULL,superuser=false,validated=true,uniqueid=F2HRGHTI5OQDKBYM1CYWR5O1T5CR2PRH}

scala> res3.address.is
res4: Long = 0
--~--~---------~--~----~------------~-------~--~----~
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