! Issue: Cannot extend Entity

15 views
Skip to first unread message

wynn....@gmail.com

unread,
Jan 25, 2015, 1:01:51 PM1/25/15
to activate-p...@googlegroups.com

Note: I have to pass an option to the persistence context. The string is not being lifted.

Can someone help me understand why I cannot extend Entity in my LoginUser class?

Thanks,
WT

Flavio W. Brasil

unread,
Jan 25, 2015, 2:14:48 PM1/25/15
to wynn....@gmail.com, activate-p...@googlegroups.com
Hey,

The errors suggests a syntax error, but I couldn’t find it. About the entities, it is necessary to use a CustomId in order to use Long. See:


Best,

-- 
Flavio W. Brasil

--
You received this message because you are subscribed to the Google Groups "Activate Persistence Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activate-persist...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wynn....@gmail.com

unread,
Jan 25, 2015, 2:59:03 PM1/25/15
to activate-p...@googlegroups.com, wynn....@gmail.com
I traced it down to companion objects... Is there any way to have a class with companion object with an Entity?
To unsubscribe from this group and stop receiving emails from it, send an email to activate-persistence+unsub...@googlegroups.com.

Flavio W. Brasil

unread,
Jan 25, 2015, 3:54:26 PM1/25/15
to wynn....@gmail.com, activate-p...@googlegroups.com
It is possible to create companion objects for entities normally.

Could you explain the issue further?

Regards,

-- 
Flavio W. Brasil

To unsubscribe from this group and stop receiving emails from it, send an email to activate-persist...@googlegroups.com.

Wynn Taylor

unread,
Jan 25, 2015, 10:46:49 PM1/25/15
to activate-p...@googlegroups.com
It appears if I have a class that extends Entity and it has a companion object (or its super class has a companion object) I get the error previously shown. If I comment out the companion class, it compiles fine.

wynn....@gmail.com

unread,
Jan 26, 2015, 10:25:29 AM1/26/15
to activate-p...@googlegroups.com, wynn....@gmail.com
After more testing it seems that if I inherit any trait or class other than Entity it doesn't compile. Not sure why I thought that the companion object was causing problems. 


To unsubscribe from this group and stop receiving emails from it, send an email to activate-persistence+unsubscrib...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Flavio W. Brasil

unread,
Jan 26, 2015, 10:55:35 AM1/26/15
to wynn....@gmail.com, activate-p...@googlegroups.com
Hi,

The syntax for mixing is:

class SomeClass extends Trait1 with Trait2 with Trait1

“extends” is used only for the first class/trait.

Regards,

-- 
Flavio W. Brasil

To unsubscribe from this group and stop receiving emails from it, send an email to activate-persist...@googlegroups.com.

wynn....@gmail.com

unread,
Jan 26, 2015, 1:29:17 PM1/26/15
to activate-p...@googlegroups.com, wynn....@gmail.com
Thanks, Flavio. 

For some reason I was under the impression that "with" got depreciated and to always use extends. I'm not sure where I got that from, but all is well now. Thank you!

Wynn
Reply all
Reply to author
Forward
0 new messages