Re: [Lift] IdPK Model boiler-plate

2010-03-07 Thread David Pollak
Good idea.  Please open a ticket at
https://liftweb.assembla.com/spaces/liftweb/tickets and assign it to me.

On Sun, Mar 7, 2010 at 10:57 AM, aw  wrote:

> My model classes mix-in IdPK and have the following boiler-plate for
> equals and hashCode:
>
> class Team extends LongKeyedMapper[Team] with IdPK {
>  
>
>  override def equals (other : Any) = other match {
>case t : Team if t.id.is == this.id.is => true
>case _ => false
>  }
>
>  override def hashCode = this.id.is.hashCode
> }
>
>
> I'm pretty sure I acquired this boiler-plate for equals and hashCode
> from this Google Group.
>
> Is this implementation for equals and hashCode a good idea?  If so,
> shouldn't it be part of the IdPK trait?
>
> --
> 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.
>
>


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



[Lift] IdPK Model boiler-plate

2010-03-07 Thread aw
My model classes mix-in IdPK and have the following boiler-plate for
equals and hashCode:

class Team extends LongKeyedMapper[Team] with IdPK {
  

  override def equals (other : Any) = other match {
case t : Team if t.id.is == this.id.is => true
case _ => false
  }

  override def hashCode = this.id.is.hashCode
}


I'm pretty sure I acquired this boiler-plate for equals and hashCode
from this Google Group.

Is this implementation for equals and hashCode a good idea?  If so,
shouldn't it be part of the IdPK trait?

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