Commit Graph

220 Commits

Author SHA1 Message Date
Oliver Gierke
8e217bb4e9 Merge pull request #2 from ractive/master
DATACMNS-46 - Make org.joda.time an optional import.
2011-06-15 11:06:00 -07:00
Oliver Gierke
23dbfe27bb Added getType() method to Parameter value object. 2011-06-15 19:43:08 +02:00
Oliver Gierke
d2e46f6770 JavaDoc polishing. 2011-06-15 19:42:47 +02:00
Oliver Gierke
736b8adf08 Refactored package structure.
Resolved dependency cycles in repository and mapping packages. Introduced repository.core package as well as core.support where most of the type of former repository.support is in now. New repository.support only contains additional stuff built on top of core repository abstraction (e.g. Converters, PropertyEditors). Added some more unit tests to core mapping abstractions and removed not needed methods from its API.
2011-06-13 20:23:26 -07:00
Oliver Gierke
5650b068ed DATACMNS-31 - Added null check to SimpleTypeHolder.isSimpleType(…).
The MappingBeanHelper mentioned in the ticket was recently replaced by SimpleTypeHolder.
2011-06-10 15:03:08 -07:00
Oliver Gierke
c9eeee545a DATACMNS-27 - Added plugin repository to allow build on Maven 3. 2011-06-10 14:53:05 -07:00
Oliver Gierke
7a13657eb5 DATACMNS-169 - Reworked simple type handling in mapping subsystem.
All simple type discovery is now done through a SimpletypeHolder instance that carries a few default types considered to be simple but is configurable to carry additional ones. The mapping subsystem uses an instance of that class to do simple type decisions and thus allows customizing what is to be considered a simple type by simply dependency injecting a value object.
2011-06-09 16:26:48 -07:00
Jean-Pierre Bergamin
cb01d85397 DATACMNS-46 - make org.joda.time an optional import 2011-06-09 09:18:45 +02:00
Oliver Gierke
351e37e4eb DATACMNS-45 - Improved property handling in TypeDiscoverer and Property.
TypeDiscoverer now looks up property type using a PropertyDescriptor if no field with the given name can be found. Property now handles _-prefixed properties as well.
2011-06-07 15:49:26 -07:00
Oliver Gierke
3453806569 DATACMNS-44 - Fixed BindableParameterIterator.hasNext(). 2011-06-07 12:43:41 -07:00
Oliver Gierke
d5300ed1bc DATACMNS-43 - Corrected exception message in PreferredConstructorDiscoverer to mention PersistenceConstructor. 2011-06-07 11:50:28 -07:00
Oliver Gierke
364a84ffb8 DATACMNS-42 - MappingBeanHelper now considers all Numbers to be simple types.
Fixed bug in isSimpleType(…) along the lines.
2011-06-06 14:44:28 -07:00
Oliver Gierke
12d5c0ddb9 Polished JavaDoc. 2011-06-06 11:07:21 -07:00
Thomas Risberg
dfca1c61a2 prepared for 1.1.0 snapshot builds 2011-06-02 08:58:14 -04:00
Thomas Risberg
dff80c6f3d prepared for Spring Data Commons 1.1.0.M1 release 2011-06-02 08:54:44 -04:00
Thomas Risberg
e7e51333a0 updated changelog 2011-06-02 08:45:01 -04:00
Oliver Gierke
70da7b00f8 DATACMNS-41 - Refactored DefaultRepositoryInformation to take custom implementation class into account as well. 2011-06-01 00:29:52 +01:00
Oliver Gierke
399bc5e6bf Made DefaultRepositoryInformation public. 2011-05-31 22:34:59 +01:00
Oliver Gierke
0ea1921a96 Updated reference documentation regarding repository declaration.
Polished Javadoc of Repository to mention possibility of selectively exposing CRUD methods.
2011-05-24 12:33:18 +02:00
Oliver Gierke
dab13128f4 Introduced BeanWrapper helper object to reduce static access through MappingBeanHelper.
Creating bean instances, getting and setting properties on a bean was done by using static methods on MappingBeanHelper so far. This required certain Spring components (ConversionService) being held statically as well. Beyond that various Spring components had set these static values which might cause strange behavior if multiple instances of these Spring components are created. Thus we now have a BeanWrapper that takes the formerly statically held instances and uses those for bean creation and property access.

Moved SpEL awareness of a mapping into SpELAwareParameterValueProvider to hide it behind an ParameterValueProvider instance.
2011-05-24 12:31:59 +02:00
Oliver Gierke
be5d43900c Moved QueryDslPredicateExecutor into Spring Data Commons. 2011-05-23 12:21:01 +02:00
Oliver Gierke
637daac97b DATACMNS-40 - Renamed @RepositoryProxy to @RepositoryDefinition. 2011-05-23 11:50:11 +02:00
Oliver Gierke
1583aea2b7 DATADOC-145 - Removed obsolete methods from MappingBeanHelper.
Fixed inverted isAssignableFrom(…) check as well.
2011-05-22 14:44:05 +02:00
Thomas Risberg
cbf8218cc0 added UserCredentials class to support DATADOC-142 2011-05-20 12:40:10 -04:00
Oliver Gierke
7a110d593e DATACMNS-38 - Prevent StackOverflow on self referencing objects.
Various improvements and additional test cases for the TypeInformation abstraction. Introduced ParameterizedTypeInformation in-between class to take the parent into account when calculating equals(…) and hashCode(). We're also shortcutting TypeInformation creation if the parent's underlying type equals the one we shall create a new TypeInformation for.

Slightly modified the parsing algorithm when adding PersistentEntity objects. We now eagerly add them to the cache to prevent endless recursive adding.
2011-05-17 20:15:52 +01:00
Oliver Gierke
66c77820c4 DATACMNS-37 - Added unit tests for annotation based repository usage. 2011-05-17 20:15:38 +01:00
Oliver Gierke
1761255c2d DATACMNS-37 - Enabled annotation based repository declaration model.
Introduced an @RepositoryProxy annotation that can be used as alternative to extending Repository. Added necessary RepositoryMetadata implementation to introspect the annotation rather than the generic types. Enabled bean definition parsers to pick up annotation based repositories as well.
2011-05-14 08:37:38 +02:00
Oliver Gierke
22f3e5cd1c Added test case to check whether declaring a CRUD method in a repository interface extending Repository is delegated to the backing bean. 2011-05-13 10:03:48 +02:00
Oliver Gierke
138191fd19 DATACMNS-34 - Fixed exception message to include class name and point to argument constructors, not no-arg ones. 2011-05-13 10:02:58 +02:00
Oliver Gierke
727bf4cc99 Moved repository declaration to find EJB jar to the right pom.xml. 2011-05-12 14:10:45 +02:00
Oliver Gierke
24394b4f1d DATACMNS-29 - Extracted Repository marker interface from CrudRepository.
This change allows creating repository proxies without exposing CRUD methods at the same time. This essentially enables query-method-only repository interfaces.
2011-05-12 13:17:55 +02:00
Oliver Gierke
d8c5bca4bd DATACMNS-36 - Improved transaction handling configuration support.
Added custom TransactionAttributeSource that favors interface transaction configuration over the implementation configuration. This allows us configuring repository implementations with @Transactional but allow overriding this configuration at the user's repository level as well.
2011-05-12 12:13:49 +02:00
Oliver Gierke
88bad20ab3 DATACMNS-29 - Added getRepositoryInterface() implementation to RepositoryConfig.
We now assume scanning for all sub-interfaces of Repository by default now. Thus concrete modules can pretty much drop the implementation of this method in their concrete config implementations in case they support picking up user's repository interfaces that extend Repository only.

From a users perspective this drops the requirement to extend a persistence technology specific interface (MongoRepository, JpaRepository and the like).
2011-05-12 11:35:16 +02:00
Oliver Gierke
369af0a12a Updated changelog. 2011-05-11 18:48:28 +02:00
Oliver Gierke
891144b543 DATACMNS-35 - Added delete(ID id) method to Repository interface. 2011-05-11 18:37:15 +02:00
Oliver Gierke
06872f23f5 Set fields and getter accessible before reading value in MappingBeanHelper. 2011-05-11 18:36:44 +02:00
Oliver Gierke
6f92b010d3 DATAJPA-59 - Added unit test for QueryMethod. 2011-05-11 13:27:51 +02:00
Jon Brisbin
e67e35ac8d Reformatting source code to use tabs instead of spaces. 2011-05-10 10:50:32 -05:00
Oliver Gierke
870d156adb DATACMNS-34 - Improved algorithm to lookup preferred constructor.
Algorithm is now was follows:

1. If there's no explicit constructor use the default constructor.
2. If there's a single explicit constructor, use this one.
3. If there's multiple explicit constructors and one has been annotated with @PersistenceConstructor use the annotated one.
4. If there's multiple explicit constructors and none annotated use the no-arg one or throw an exception to resolve the ambiguity.

Test cases for that algorithm are located in PreferredConstructorDiscovererUnitTests. Refactored PreferredConstructor and Parameter classes a little to make them immutable value objects. Introduced ability to lookup parameter TypeInformation for constructors on TypeInformation interface.

Extended generics in mapping subsystem to allow defining a concrete subtype of PersistentProperty as well. Removed some generics related compiler warnings as well.
2011-05-10 10:15:46 +02:00
Oliver Gierke
ff51b134f9 DATADOC-43 Added Near and Within as part types to support spatial repository queries. 2011-05-03 15:12:22 +02:00
Oliver Gierke
7590f55547 DATADOC-115 - Upgraded to Querydsl 2.2.0-beta4.
Unfortunately the beta version numbers of Querydsl are not OSGi compatible so that we have to maintain the version number in template.mf manually. Updated version of APT Maven plugin to 1.0.1.
2011-05-03 11:49:53 +02:00
Oliver Gierke
54ada02ae8 DATADOC-109 - Refactored mapping subsystem.
Refactored BasicMappingContext into AbstractMappingContext that now only contains the general algorithm to build PersistentEntity and PersistentProperty instances. The algorithm delegates to two template methods that are responsible for instantiating concrete implementations of those classes.

Extracted an AnnotationBasedPersistentProperty that now contains all annotation references so that AbstractPersistentEntity does not take annotations into account in the first places. BasicPersistentEntity now does PreferredConstructor lookup as well.

Removed unnecessary methods from MappingCOntext and PersistentEntity interface. Added a verify() method to BasicPersistentEntity that AbstractMappingContext calls to verify validity of the entity. This will be used by the Mongo module for example to make sure @Document annotated entities have an @Id property.

Refactored getValueAnnotation() to getSpelExpression() to not imply we're using annotations in every case.

Added shortcut in TypeDiscoverer.createInfo(…) to prevent endless loop in case a type has a field of it's very same type.

TypeDiscoverer now returns the plain compound type for arrays now, which means you get String for String[], String[][] and so on. Opened up signature of AbstractMappingContext.setInitialEntitySet(…) to allow effortless programatic invocation.
2011-04-28 21:34:08 +02:00
Oliver Gierke
d0569e0cb4 DATACMNS-33 - Changed return type of Repository.count() to primitive long. 2011-04-21 09:54:15 +02:00
Oliver Gierke
b6845e7310 DATACMNS-32 - Refactored Querydsl support code from JPA and Mongo module into core. 2011-04-20 20:38:20 +02:00
Mark Pollack
c2b8a1cf1a update changelog.txt to include information for M7, RC1 and 1.0.0 GA release 2011-04-20 11:47:59 -04:00
Oliver Gierke
3f22104c7c DATACMNS-30 - Made implementations of Page, Pageable and Sort serializable. 2011-04-20 17:18:57 +02:00
J. Brisbin
9ff83e6542 DATADOC-98 - Fixes for multi-dimensional arrays and lists 2011-04-19 12:49:43 -05:00
Thomas Risberg
9b645aa370 removed release repositories 2011-04-18 18:01:41 -04:00
trisberg
3aed2e87fe prepared for 1.1.0 snapshot builds 2011-04-18 17:52:08 -04:00
trisberg
bc130ab9fd prepared for Spring Data Commons 1.0.0.RELEASE 2011-04-18 17:49:12 -04:00