SquerylRecord ProtoUser - id method

61 views
Skip to first unread message

Etam

unread,
Oct 1, 2012, 6:47:13 AM10/1/12
to lif...@googlegroups.com
Hi,

how dou you use ProtoUser with Squeryl records?

There is a problem:

overriding lazy value id in trait ProtoUser of type net.liftweb.record.field.LongField[domain.model.User];
[error]  method id in trait KeyedRecord of type => Long needs `override' modifier

Thanks,
Etam.

David Whittaker

unread,
Oct 1, 2012, 10:42:39 AM10/1/12
to lif...@googlegroups.com
Hi Etam,

For the moment, you don't.  Your best bet is to copy the ProtoUser code and change it accordingly.

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 

Etam

unread,
Oct 1, 2012, 3:35:39 PM10/1/12
to lif...@googlegroups.com
Hmmm :(, there is another problem:

[error] /etabl/src/main/scala/com/etabl/model/User.scala:14: overriding type FieldPointerType in trait MetaMegaProtoUser, which equals net.liftweb.mapper.MappedField[_, com.etabl.model.User.TheUserType];
[error]  type FieldPointerType in trait CRUDify, which equals net.liftweb.mapper.MappedField[_, com.etabl.model.User] needs `override' modifier;
[error]  other members with override errors are: computeFieldFromPointer, buildFieldBridge, editPath, menus

while:

object User
  extends User
  with MetaMegaProtoUser[User]
  with CRUDify[Long, User] { ...

I had to change its name. This is a very dirty solution ;).

Thanks,
Etam.

David Whittaker

unread,
Oct 1, 2012, 4:13:13 PM10/1/12
to lif...@googlegroups.com
I agree that it's dirty, but I don't see why you'd have issues with override.  If you copy the code into your own project, you should be able to just change the methods directly.

--

Etam

unread,
Nov 14, 2012, 1:02:28 PM11/14/12
to lif...@googlegroups.com
Is it going to be fixed?

David Whittaker

unread,
Nov 14, 2012, 2:44:21 PM11/14/12
to liftweb
What in particular?


--

Etam

unread,
Nov 15, 2012, 4:24:29 AM11/15/12
to lif...@googlegroups.com
The ProtoUser class so you could be able to extend it with KeyedRecord from SquerylRecord.

W dniu środa, 14 listopada 2012 20:45:07 UTC+1 użytkownik David Whittaker napisał:
What in particular?

David Whittaker

unread,
Nov 15, 2012, 10:14:22 AM11/15/12
to liftweb
I had considered refactoring ProtoUser so that it doesn't define an id field.  Squeryl 0.9.6 will be more flexible about how primary keys are defined though.  Right now, I'm leaning towards waiting until it's released, then adding ProtoUser support to the SquerylRecord version based on it.


--
Reply all
Reply to author
Forward
0 new messages