Have a need to persist a 3rd party case class

53 views
Skip to first unread message

erich oliphant

unread,
Nov 27, 2013, 1:26:24 AM11/27/13
to activate-p...@googlegroups.com
Hi, I have a case class from a library I'm using that I need to persist.  Given that this isn't Activate's normal approach, I'm curious about the best way to solve this.  

So I have something like:

case class ThirdParty (a:String,b:String)

that needs to both be persisted and interact with the library in question. I know generally case class inheritance is bad and I'm not really sure how activate will behave if I try I dunno somethign like:

class ThirdPartyAct(a:String,b:String) extends ThirdParty(a,b) with Entity

Or I'd considered making a 'pure entity' and mapping to-from it as well but again, not sure of the best approach.

Flavio W. Brasil

unread,
Nov 27, 2013, 11:03:23 AM11/27/13
to erich oliphant, activate-p...@googlegroups.com
Hi Erich,

Do you have other entities that will have relations with the instances of the third party class? The class is very simple like on the example?

Regards,

-- 
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/groups/opt_out.

sebasti...@googlemail.com

unread,
Oct 21, 2015, 9:57:37 AM10/21/15
to Activate Persistence Framework
Hi Falvio,

I stumbled across the same question:

class ThirdPartyAct(a:String,b:String) extends ThirdParty(a,b) with Entity

After deserializing ThirdPartyAct both variables a,b are null. What is the reason for this behavior (as a,b are also fields of ThirdPartyAct and should be serializable) and how to resolve it?

(Background: Sometimes I need to create ThirdParty objects without transparent persitance. This way, I create ThirdPartyAct objects if I need persistance and ThirdParty objects if not. Unfortunately, this doesn't work as I expected) 

Regards and thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to activate-persistence+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages