This content has been marked as final. Show 2 replies
When you add @Entity to a class, that creates a PrimaryIndex that stores all instances of that class separately from all other instances. From your example, I gather that you want to store all credentials in a single PrimaryIndex, is that correct?
To do that you need a base class -- not an interface -- that all credential classes extend. For example, you could call it AbstractCredential. This is the class that should have the @Entity annotation. And you should pass this class (AbstractCredential.class) to EntityStore.getPrimaryIndex.
You can have an interface for Credential that is implemented by AbstractCredential. But the @Entity class must be a class not an interface.
Then each of the subclasses, UserPasswordCredentials, etc, can extend AbstractCredential. These subclasses should be annotated with @Persistent.