-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Id Annotation isn't inherited by child classes #37
Comments
Thanks for the kind words, I am glad you like it. For the feature itself, I am working on it. |
This feature should be available in 2.1.0.SNAPSHOT now. I have added a new annotation The feature works like as follows: @Index(value = "text", type = IndexType.Fulltext)
public class SuperDuperClass {
public String text;
}
@Indices(
@Index(value = "date", type = IndexType.Unique)
)
public class ParentClass extends SuperDuperClass {
@Id
public Long id;
public Date date;
}
@InheritIndices
public class ChildClass extends ParentClass {
public String name;
} Now the |
Now that's dedication. My hat's off to you sir.
…On Tue, Nov 28, 2017 at 4:18 AM, Anindya Chatterjee < ***@***.***> wrote:
This feature should be available in 2.1.0.SNAPSHOT now.
I have added a new annotation @InheritIndices that you should apply on
the child class. Once applied it will consider all index related
annotations @id, @Index, @indices through out the class hierarchy.
The feature works like as follows:
@Index(value = "text", type = IndexType.Fulltext)public class SuperDuperClass {
public String text;
}
@indices(
@Index(value = "date", type = IndexType.Unique)
)public class ParentClass extends SuperDuperClass {
@id
public Long id;
public Date date;
}
@InheritIndicespublic class ChildClass extends ParentClass {
public String name;
}
Now the ChildClass will have indices for fields - text, date and id.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABFMb6xENFaCaf6ZG97oA2vB-oNk7u9Zks5s693_gaJpZM4QsYun>
.
|
Perhaps an annotation similar to @MappedSuper in JPA so if I am using the same id field in each entity I can just extend a parent class instead of having to mark up an id field in every class.
Otherwise great library, much better than CouchbaseLite. Especially since it doesn't require any native libraries.
The text was updated successfully, but these errors were encountered: