I'm having a bit of trouble with a mapper class I'm trying to make.
Everything is working fine, except that I cannot get the id of the
newly-saved class - it always returns the default value (-1L). Here is
what my class looks like:
object Job extends Job with LongKeyedMetaMapper[Job] {
}
class Job extends LongKeyedMapper[Job] with IdPK {
.. fields here...
}
Here is the save code I am trying:
job.save
Log.info("JOB ID: " + job.id)
I've also tried:
job.save
val newJob = job.reload
Log.info("JOB ID:" + newJob.id)
I'm using mySQL 5.1.
Any ideas on why I'm never seeing the generated key, and what the
correct approach would be?
Thanks,
- Spencer
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---