Commit Graph

151 Commits

Author SHA1 Message Date
J. Brisbin
fec5bae808 Added MappingContextAware interface and BeanPostProcessor for same 2011-04-05 14:56:30 -05:00
J. Brisbin
c6ad0f99fe Merge branch 'master' of github.com:SpringSource/spring-data-commons 2011-04-01 11:29:14 -05:00
J. Brisbin
3f746ebf4f Added array primitives to simple types 2011-04-01 11:28:54 -05:00
Oliver Gierke
4b51c5fd1f DATACMNS-23 - Made PageImpl safe to take an empty collection.
Added hasContent() method to Page interface.
2011-04-01 08:34:39 +02:00
Oliver Gierke
c4d81a28f1 DATACMNS-25 - Refactored RepositoryFactorySupport.getQueryLookupStrategy(…)
Method is not abstract anymore but rather returns null by default. Adapted QueryExecutionMethodInterceptor to handle the null case appropriately by simply skipping the query lookup. It also throws an exception if the repository has query methods defined nonetheless to prevent exceptions at runtime.
2011-03-31 21:46:33 +02:00
Oliver Gierke
9931e885c0 Expose type of a query parser Property. 2011-03-31 18:24:03 +02:00
Oliver Gierke
6bb0923c14 DATACMNS-26 - Persistent constructor now detects non-public constructor. 2011-03-29 19:19:23 +02:00
Oliver Gierke
95ff87e959 Configured Maven JAR plugin to package the Bundlor generated MANIFEST.MF. 2011-03-29 08:48:58 +02:00
Oliver Gierke
c05bedce17 Fixed bug in Property. 2011-03-28 20:32:12 +02:00
Thomas Risberg
23ff75ee6e needed access to entity when use with partial JPA/cross-store persistence 2011-03-28 13:55:01 -04:00
Oliver Gierke
b39c2cacc9 Refactored Property to use TypeInformation infrastructure.
Fixed bug in discovering invalid property names of nested properties.
2011-03-28 09:25:40 +02:00
Oliver Gierke
6d404527ed Added isCollectionLike() and isMap() to TypeInformation interface.
isCollectionLike() allows identifying element containers like Arrays, Collections or everything else implementing Iterable.
2011-03-28 09:24:39 +02:00
Thomas Risberg
c0da416a17 prepared for snapshot builds 2011-03-25 16:48:37 -04:00
Thomas Risberg
06656ae062 preparing for 1.0.0.M6 2011-03-25 16:46:33 -04:00
Michael Hunger
b52de879de extracted StateBackedCreator interface 2011-03-25 11:22:20 +01:00
Michael Hunger
8fa7aabdc0 added caching to AbstractConstructorEntityInstantiator 2011-03-24 22:37:09 +01:00
Oliver Gierke
e39f3724e2 Use BeanUtils to instantiate objects to not enforce them to be public. 2011-03-24 15:47:17 +01:00
Thomas Risberg
8af071664e prepared for snapshot builds 2011-03-23 19:48:43 -04:00
Thomas Risberg
22243d05ce preparing for 1.0.0.M5 2011-03-23 19:44:27 -04:00
Thomas Risberg
71ea5ddaed pruned unused cross-store prototype classes; changed package names 2011-03-23 11:26:29 -04:00
Oliver Gierke
b32e444749 Updated changelog. 2011-03-23 10:05:42 +01:00
Oliver Gierke
6672a206c7 DATAJPA-19 - Moved extension classes into Spring Data Commons Core. 2011-03-23 10:05:33 +01:00
Oliver Gierke
a2dc608ab4 Forgot to push deleting MappingConfigurationBuilder and BasicMappingConfigurationBuilder. 2011-03-23 09:45:08 +01:00
Oliver Gierke
ecdda346b1 Extended AbstractRepositoryConfigDefinitionParser.postProcessBeanDefinition(…) to take BeanDefinitionRegistry as well. 2011-03-23 09:10:52 +01:00
Oliver Gierke
b514e35105 Removed some compiler warnings and unnecessary imports. 2011-03-23 07:46:08 +01:00
Oliver Gierke
b7c81e3a4e Cleanup of meta-model API.
Moved MappingConfigurationBuilder functionality into BasicMappingContext. Got rid of obsolete methods in MappingContext, PersistentEntity and PersistentProperty to minimize the API exposed.
2011-03-23 07:31:26 +01:00
Oliver Gierke
06463a0b58 Tweaks to BasicMappingContext.
Re-added a initialEntitySet property to BasicMappingContext and let trigger adding those to the context in afterPropertiesSet(). Moved createPersistentEntity and createPersistentProperty methods from MappingConfigurationBuilder into BasicMappingContext (could probably be done for all of those methods still in MCB).

Opened up getPersistentEntites() in MappingContext interface to return Collection<? extends PersistentEntity> to allow easy overriding in subclasses with more specific types.
2011-03-22 21:17:27 +01:00
Jon Brisbin
f6818dd13f Fix for edge case where constructor parameter names aren't available causing the mapping framework to barf. 2011-03-22 14:08:48 -05:00
Oliver Gierke
33efa23492 DATACMNS-22 - Added Spring release repository as plugin repository.
Needed to lookup AWS build extension.
2011-03-20 19:24:08 +01:00
Jon Brisbin
c51d5b5441 Added TypeInformation to the MappingContextEvent 2011-03-18 09:36:51 -05:00
Burt Beckwith
cfcb4cecd0 removed @Override on interface methods that will cause problems in Java 5 2011-03-17 23:26:14 -04:00
Oliver Gierke
561cdbe4dc Cleanups in ClassTypeInformation as well as BasicMappingContext.
Removed obsolete constructor arguments in ClassTypeInformation. SKip static fields in BasicMappingContext.addPersistentEntity(…).
2011-03-17 22:56:06 +01:00
Oliver Gierke
f00bfb82bd Fix to correctly determine component type for non-generic arrays. 2011-03-17 10:06:18 +01:00
Oliver Gierke
688ae81b27 Fixed failing test. 2011-03-17 09:50:05 +01:00
Oliver Gierke
a93880a60e Added customSimpleTypes to BasicMappingContext.
The added custom simple types will be considered in the decision whether to recursively add PersistentEntities. This does not feel quite right for now as for a complete setup we now have to register converters in the MappingMongoConverter *and* add the custom type to the list here. Open for discussion.
2011-03-17 09:45:59 +01:00
Oliver Gierke
ab59c57577 Tweaked getComponentType() and added getMapValueType() to PersistentProperty.
Changed implementation of getComponentType() to use the TypeInformation instance backing the BasicPersistentProperty.
2011-03-17 09:44:35 +01:00
Oliver Gierke
a07a2cc760 Added isEntity() method to PersistentProperty. 2011-03-17 09:44:35 +01:00
Oliver Gierke
7a2f25190a Extended TypeInformation classes to support generic arrays as well.
Additionally added support for resolving component types (for collections and map keys) as well as map value types.
2011-03-17 09:44:35 +01:00
Oliver Gierke
8ab42a266c Some tweaks to handling collections and enums.
Fixed isAssignableFrom(…) usage in BasicPersistentProperty to correctly detect collections and maps. Let MappingBeanHelper treat enums as simple types as well.
2011-03-17 09:44:34 +01:00
Jon Brisbin
bc6e9d8f54 Added the ability to use the Spring 3.0 ApplicationEvent mechanism for event handling internally within the mapping framework. 2011-03-16 15:37:49 -05:00
Thomas Risberg
626d52e2c0 prepared for snapshot builds 2011-03-15 22:34:46 -04:00
Thomas Risberg
206e73d1ef preparing for M4 2011-03-15 22:28:27 -04:00
Thomas Risberg
8640511347 preparing for M4 2011-03-15 22:24:58 -04:00
Oliver Gierke
ad56cae06e Extended basic mapping framework to support working with generics.
Added TypeInformation interface and infrastructure to discover generic types given a basic type that binds generic types. Starting from that you can then traverse TypeInformations for fields by calling getProperty(…). A subsequent call to getType() will then return the resolved type.

Adapted the Basic mapping infrastructure to accomodate the TypeInformation interfaces where necessary. In most cases it was just about using TypeInformation instead of class as we have to keep track of the parent types that (in case of a generic field) determine the actual type of sub fields. BasicMappingContext is now using the TypeInformation instance created for PersistentEntity as key for the cache. This is necessary as generic types (e.g. Foo<T>) might be used inside different entities that type T to something different.

Created isMap() and isArray() on PersistentProperty to align to isCollection().
2011-03-15 17:28:30 +01:00
Jon Brisbin
69d007c2b8 Mostly fixing IDE warnings and complainings about type safety issues 2011-03-14 16:58:08 -05:00
Jon Brisbin
1f9af56158 More tweaks to complex/simple type detection, add makeAccessible() call to BasicMappingContext 2011-03-14 10:53:31 -05:00
Jon Brisbin
e287cd23d6 Tweaked the way complex/simple types are discovered. 2011-03-14 09:06:56 -05:00
Oliver Gierke
ecb12f70a2 Moved special id-property handling into PersistentProperty interface.
The PersistentProperty interface now has a isIdPropertyMethod(). Subclasses might alter it to support further id property detection mechanisms. Added missing import in BasicPersistentProperty.
2011-03-13 09:06:50 +01:00
Oliver Gierke
5a879ffd92 Use Spring's ReflectionUtils.doWithFields(…) to simplify code.
Spring already contains functionality to to something with all fields of
a class including all fields from superclasses. Refactored the field
collecting code to use this.
2011-03-13 09:06:26 +01:00
Oliver Gierke
dec48921ce Removed Mongo specific id field name handling from common BasicMappingConfigurationBuilder. 2011-03-13 09:06:25 +01:00