Skip to content

Conversation

@christophstrobl
Copy link
Member

We introduced @ReadOnlyProperty which can be used for excluding properties from being persisted. The AnnotationBasedPersistentProperty.isReadOnly() will return true in that case, while PersistentProperty.shallBePersisted() returns false.

@Transient supersedes @ReadOnlyProperty.

@ReadOnlyProperty can be used as meta-annotation for others like @TextScore in spring data mongodb.

…ntProperty.

We introduced optional annotations for @ReadingProperty and @WritingProperty which can be used for marking properties for being persisted to or only read from the store. Both annotations can be used as meta-annotations for building special ones like eg. @score in Spring Data Mongodb.

Having none of these annotations used will behave as if both annotations where present. This means that

@ReadingProperty @WritingProperty String foo;

is will return the same for property.isReading() and property.isWriting() as plain

String foo;

Both annotations are superseded by @transient which will force isReading() and isWriting() to false;
@odrotbohm
Copy link
Member

I actually thought we decided to go with the less sophisticated variant for now:

  • turn @ReadingProperty into @ReadOnlyProperty, dropping @WritingProperty
  • I'd go with PersistentProperty.isWritable() for now which would return false in case of the presence of @ReadOnlyProperty.

That should make the changes a bit smaller. Is that still sufficient for the use case in the Solr module?

…ntProperty.

We introduced @ReadOnlyProperty which can be used for excluding properties from being persisted. 

@transient supersedes @ReadOnlyProperty.

@ReadOnlyProperty can be used as meta-annotation for others like @TextScore in spring data mongodb.
christophstrobl added a commit that referenced this pull request Jul 9, 2014
This commit introduces @ReadOnlyProperty to mark properties as not to be persisted. That trait is exposed via the newly added PersistentProperty.isWritable() which supersedes shallBePersisted(). Currently all non-transient property that are not annotated with @ReadOnlyProperty are considered writable.

Original pull request: #88.
@odrotbohm odrotbohm closed this Jul 9, 2014
@odrotbohm odrotbohm deleted the issue/DATACMNS-534 branch July 9, 2014 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants