Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-847

Use AccessType.PROPERTY for entites that extend Map

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Mapping / Conversion
    • Labels:
      None

      Description

      An entity extending a Map implementation will by default only have PersistentProperties of the Map itself. Like size and those. But not list the ones available via property accessors.

      	static class PropertyAccessOnMap extends HashMap<String, Object> {
      
      		public void setName(String name) {
      			put("name", name);
      		}
      
      		public void getName() {
      			get("name");
      		}
      	}
      

      In that case SamplePersistentProperty prop = getProperty(PropertyAccessOnMap.class, "name"); returns null.

      Switching the AccessType to AccessTpye.Property returns the property `GenericTypeAwarePropertyDescriptor`.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              cstrobl Christoph Strobl
              Last updater:
              Jens Schauder
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: