Permalink
Browse files

Revert "Revert "whitespace, javadoc, cleanup""

This reverts commit 3d63fc1.
  • Loading branch information...
1 parent 7d63276 commit 214c9e3d1eb0d0acb8f428c9e88399d141dc956d @graemerocher graemerocher committed Mar 18, 2013
Showing with 275 additions and 330 deletions.
  1. +10 −17 build.gradle
  2. +4 −4 grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/cache/TPCacheAdapter.java
  3. +7 −7 ...s-datastore-core/src/main/groovy/org/grails/datastore/mapping/cache/TPCacheAdapterRepository.java
  4. +0 −3 grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/model/AbstractMappingContext.java
  5. +1 −2 ...s-datastore-core/src/main/groovy/org/grails/datastore/mapping/model/AbstractPersistentEntity.java
  6. +0 −1 ...rc/main/groovy/org/grails/datastore/mapping/model/config/DefaultMappingConfigurationStrategy.java
  7. +1 −2 ...e/src/main/groovy/org/grails/datastore/mapping/model/config/GormMappingConfigurationStrategy.java
  8. +4 −3 ...tastore-core/src/main/groovy/org/grails/datastore/mapping/validation/ValidatingEventListener.java
  9. +2 −2 ...s-datastore-dynamodb/src/main/groovy/org/grails/datastore/mapping/dynamodb/DynamoDBDatastore.java
  10. +3 −3 ...-dynamodb/src/main/groovy/org/grails/datastore/mapping/dynamodb/engine/DynamoDBTableResolver.java
  11. +2 −2 ...datastore-dynamodb/src/main/groovy/org/grails/datastore/mapping/dynamodb/query/DynamoDBQuery.java
  12. +13 −13 ...tastore-dynamodb/src/main/groovy/org/grails/datastore/mapping/dynamodb/util/DynamoDBTemplate.java
  13. +0 −44 ...ore-dynamodb/src/main/groovy/org/grails/datastore/mapping/dynamodb/util/DynamoDBTemplateImpl.java
  14. +4 −4 ...s-datastore-dynamodb/src/main/groovy/org/grails/datastore/mapping/dynamodb/util/DynamoDBUtil.java
  15. +5 −4 ...ls-datastore-gorm-mongo/src/test/groovy/grails/gorm/tests/DirtyCheckEmbeddedCollectionSpec.groovy
  16. +7 −5 ...store-gorm-mongo/src/test/groovy/org/grails/datastore/gorm/mongo/CustomTypeMarshallingSpec.groovy
  17. +6 −4 ...-mongo/src/test/groovy/org/grails/datastore/gorm/mongo/EmbeddedHasManyWithBeforeUpdateSpec.groovy
  18. +5 −4 ...s-datastore-gorm-mongo/src/test/groovy/org/grails/datastore/gorm/mongo/GeospacialQuerySpec.groovy
  19. +0 −4 ...datastore-gorm-mongo/src/test/groovy/org/grails/datastore/gorm/mongo/OneToOneIntegritySpec.groovy
  20. +9 −5 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/ConstraintsSpec.groovy
  21. +10 −8 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/GormDatastoreSpec.groovy
  22. +8 −3 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/NamedQuerySpec.groovy
  23. +0 −4 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/OneToOneSpec.groovy
  24. +6 −1 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/OptimisticLockingSpec.groovy
  25. +57 −61 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/PersistenceEventListenerSpec.groovy
  26. +6 −5 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/PropertyComparisonQuerySpec.groovy
  27. +15 −15 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/RangeQuerySpec.groovy
  28. +3 −1 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/TestEntity.groovy
  29. +22 −20 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/UniqueConstraintSpec.groovy
  30. +6 −3 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/UpdateWithProxyPresentSpec.groovy
  31. +4 −4 grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/ValidationSpec.groovy
  32. +5 −4 ...m-test/src/test/groovy/org/grails/datastore/gorm/BidirectionalOneToManyWithInheritanceSpec.groovy
  33. +3 −2 grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/CircularManyToManySpec.groovy
  34. +5 −5 ...ls-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/CustomTypeMarshallingSpec.groovy
  35. +5 −4 grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/DeindexingSpec.groovy
  36. +1 −2 grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/DistinctProjectionSpec.groovy
  37. +6 −4 grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/EmbeddedAssociationSpec.groovy
  38. +5 −4 ...store-gorm-test/src/test/groovy/org/grails/datastore/gorm/EmbeddedNonEntityAssociationSpec.groovy
  39. +0 −2 grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/OrderBySpec.groovy
  40. +14 −19 grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/GormInstanceApi.groovy
  41. +7 −20 grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/GormStaticApi.groovy
  42. +1 −1 grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/GormValidationApi.groovy
  43. +1 −2 ...tore-gorm/src/main/groovy/org/grails/datastore/gorm/config/GrailsDomainClassPersistentEntity.java
  44. +0 −1 ...-jpa/src/main/groovy/org/grails/datastore/mapping/jpa/config/JpaMappingConfigurationStrategy.java
  45. +2 −2 grails-plugins/redis/build.gradle
View
@@ -95,7 +95,6 @@ subprojects {
def isGormDatasource = project.name.startsWith("grails-datastore-gorm-") && !project.name.endsWith("tck") && !project.name.endsWith("plugin-support")
def isDocumentationProject = project.name.startsWith("grails-documentation")
-
dependencies {
if (isStandardGroovyMavenProject) {
groovy group: 'org.codehaus.groovy', name: 'groovy-all', version: groovyVersion
@@ -110,8 +109,8 @@ subprojects {
compile spockDependency
}
}
-
- if(isDocumentationProject) {
+
+ if (isDocumentationProject) {
configurations {
documentation
}
@@ -121,7 +120,7 @@ subprojects {
documentation "org.slf4j:jcl-over-slf4j:$slf4jVersion"
documentation "org.slf4j:slf4j-api:$slf4jVersion"
documentation "org.slf4j:slf4j-simple:$slf4jVersion"
- }
+ }
task docs << {
ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
classpath {
@@ -131,16 +130,14 @@ subprojects {
}
}
- ant.docs(src:"src/docs", dest:destinationDir, properties:"src/docs/doc.properties")
+ ant.docs(src:"src/docs", dest:destinationDir, properties:"src/docs/doc.properties")
}
docs.ext.destinationDir = "${buildDir}/docs"
task clean << {
ant.delete(dir:buildDir)
}
-
-
}
if (isGormDatasource) {
@@ -204,7 +201,6 @@ subprojects {
from javadoc.destinationDir
}
-
artifacts {
archives jar
archives sourcesJar
@@ -326,34 +322,33 @@ task allDocs(dependsOn: getTasksByName("docs", true)) << {
for(task in docTasks) {
def dir = task.destinationDir
def projectName = task.project.name
- if(projectName.endsWith("core")) {
+ if (projectName.endsWith("core")) {
mkdir "$allDocsDir/manual"
fileTree { from dir }.copy { into "$allDocsDir/manual" }
def groovydocTask = groovydocTasks.find { it.project.name.endsWith "core" }
- if(groovydocTask != null) {
+ if (groovydocTask != null) {
mkdir "$allDocsDir/api"
groovydocTask.actions.each { it.execute(groovydocTask) }
fileTree { from groovydocTask.destinationDir }.copy { into "$allDocsDir/api"}
}
-
}
else {
def storeName = projectName["grails-documentation-".size()..-1]
stores << storeName
def docsDir = "$allDocsDir/$storeName"
mkdir docsDir
def groovydocTask = groovydocTasks.find { it.project.name == "grails-datastore-$storeName" }
- if(groovydocTask == null) groovydocTask = groovydocTasks.find { it.project.name == "grails-datastore-gorm-$storeName" }
- if(groovydocTask != null) {
+ if (groovydocTask == null) groovydocTask = groovydocTasks.find { it.project.name == "grails-datastore-gorm-$storeName" }
+ if (groovydocTask != null) {
mkdir "$docsDir/api"
groovydocTask.actions.each { it.execute(groovydocTask) }
fileTree { from groovydocTask.destinationDir }.copy { into "$docsDir/api"}
}
mkdir "$docsDir/manual"
fileTree { from dir }.copy { into "$docsDir/manual" }
}
-
+
def engine = new groovy.text.SimpleTemplateEngine()
def binding = [
datastores:stores.collect { "<li><a href=\"$it/index.html\">GORM for ${it[0].toUpperCase()}${it[1..-1]}</a></li>" }.join(System.getProperty("line.separator"))
@@ -369,11 +364,10 @@ task allDocs(dependsOn: getTasksByName("docs", true)) << {
]
template = engine.createTemplate(new File("src/docs/resources/datastore.template")).make( binding )
new File(index).text = template.toString()
-
}
}
-
}
+
task test(dependsOn: getTasksByName("test", true)) << {
def reportsDir = "${buildDir}/reports"
@@ -422,4 +416,3 @@ task test(dependsOn: getTasksByName("test", true)) << {
ant."clover-html-report"(initstring: mergedDb, outdir:"${cloverReportsDir}/html")
}
}
-
@@ -30,16 +30,16 @@
* In cases when there is no transaction or no transactional support by the implementation, if there are any problems
* storing the entry the caller is notified about it via exception in the calling thread; also, if this method returns
* successfully it means that the logistics of putting the specified value in the cache are fully done.
- * @param key
- * @param entry
+ * @param key the entry key
+ * @param entry the entry
* @throws CacheException runtime exception indicating any cache-related problems
*/
void cacheEntry(Serializable key, T entry) throws CacheException;
/**
* Returns the stored value for the specified key.
- * @param key
- * @return
+ * @param key the entry key
+ * @return the entry
* @throws CacheException runtime exception indicating any cache-related problems
*/
T getCachedEntry(Serializable key) throws CacheException;
@@ -10,32 +10,32 @@
public interface TPCacheAdapterRepository<T> {
/**
* Returns {@link TPCacheAdapter} for the specified {@link PersistentEntity}.
- * @param entity
+ * @param entity the entity
* @return null if no {@link TPCacheAdapter} is found for the specified entity
*/
TPCacheAdapter<T> getTPCacheAdapter(PersistentEntity entity);
/**
* Sets {@link TPCacheAdapter} for the specified {@link PersistentEntity}.
* If the specified entity had another cache adapter before, the old one is ignored after this call.
- * @param entity
- * @param cacheAdapter
+ * @param entity the entity
+ * @param cacheAdapter the adapter
*/
void setTPCacheAdapter(PersistentEntity entity, TPCacheAdapter<T> cacheAdapter);
/**
* Sets {@link TPCacheAdapter} for the specified java class of {@link PersistentEntity}.
* If the specified entity had another cache adapter before, the old one is ignored after this call.
- * @param entityJavaClass equivalent to {@link PersistentEntity.getJavaClass()}
- * @param cacheAdapter
+ * @param entityJavaClass equivalent to {@link PersistentEntity#getJavaClass()}
+ * @param cacheAdapter the adapter
*/
void setTPCacheAdapter(@SuppressWarnings("rawtypes") Class entityJavaClass, TPCacheAdapter<T> cacheAdapter);
/**
* Sets {@link TPCacheAdapter} for the specified FQN java class of {@link PersistentEntity}.
* If the specified entity had another cache adapter before, the old one is ignored after this call.
- * @param entityJavaClassFQN equivalent to {@link PersistentEntity.getJavaClass().getName()}
- * @param cacheAdapter
+ * @param entityJavaClassFQN equivalent to {@link PersistentEntity#getJavaClass().getName()}
+ * @param cacheAdapter the adapter
*/
void setTPCacheAdapter(String entityJavaClassFQN, TPCacheAdapter<T> cacheAdapter);
}
@@ -167,7 +167,6 @@ public PersistentEntity addPersistentEntity(Class javaClass, boolean override) {
return addPersistentEntity(javaClass);
}
- @Override
public Collection<PersistentEntity> addPersistentEntities(Class... javaClasses) {
Collection<PersistentEntity> entities = new ArrayList<PersistentEntity>();
@@ -235,15 +234,13 @@ private void registerEntityWithContext(PersistentEntity entity) {
persistentEntitiesByName.put(entity.getName(), entity);
}
- @Override
public void initialize() {
for(PersistentEntity entity : persistentEntities) {
initializePersistentEntity(entity);
}
this.initialized = true;
}
- @Override
public boolean isInitialized() {
return initialized;
}
@@ -72,9 +72,8 @@ public MappingContext getMappingContext() {
return context;
}
- @Override
public boolean isInitialized() {
- return this.initialized;
+ return initialized;
}
public void initialize() {
@@ -129,7 +129,6 @@ public IdentityMapping getIdentityMapping(ClassMapping classMapping) {
return getDefaultIdentityMapping(classMapping);
}
- @Override
public void setCanExpandMappingContext(boolean canExpandMappingContext) {
// noop
}
@@ -88,7 +88,6 @@ public GormMappingConfigurationStrategy(MappingFactory propertyFactory) {
/**
* Whether the strategy can add new entities to the mapping context
*/
- @Override
public void setCanExpandMappingContext(boolean canExpandMappingContext) {
this.canExpandMappingContext = canExpandMappingContext;
}
@@ -633,7 +632,7 @@ else if (!embedded && Collection.class.isAssignableFrom(relatedClassPropertyType
* check if mappedBy is set explicitly to null for the given property.
* @param property
* @param mappedBy
- * @return
+ * @return true if mappedBy is set explicitly to null
*/
private boolean forceUnidirectional(PropertyDescriptor property, Map mappedBy) {
return mappedBy.containsKey(property.getName()) && (mappedBy.get(property.getName())==null);
@@ -14,22 +14,23 @@
*/
package org.grails.datastore.mapping.validation;
+import javax.persistence.FlushModeType;
+
import org.grails.datastore.mapping.core.Datastore;
import org.grails.datastore.mapping.core.Session;
import org.grails.datastore.mapping.engine.EntityAccess;
import org.grails.datastore.mapping.engine.event.AbstractPersistenceEvent;
import org.grails.datastore.mapping.engine.event.AbstractPersistenceEventListener;
+import org.grails.datastore.mapping.engine.event.PersistenceEventListener;
import org.grails.datastore.mapping.engine.event.PreInsertEvent;
import org.grails.datastore.mapping.engine.event.PreUpdateEvent;
import org.grails.datastore.mapping.model.PersistentEntity;
import org.springframework.context.ApplicationEvent;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
-import javax.persistence.FlushModeType;
-
/**
- * An {@link org.grails.datastore.mapping.engine.EntityInterceptor} that uses
+ * A {@link PersistenceEventListener} that uses
* Spring's validation mechanism to evict objects if an error occurs
*
* @author Graeme Rocher
@@ -180,7 +180,7 @@ public DynamoDBAssociationInfo getAssociationInfo(Association<?> association) {
/**
* Returns table resolver for the specified entity.
* @param entity
- * @return
+ * @return the resolver
*/
public DynamoDBTableResolver getEntityDomainResolver(PersistentEntity entity) {
return entityDomainResolverMap.get(entity);
@@ -189,7 +189,7 @@ public DynamoDBTableResolver getEntityDomainResolver(PersistentEntity entity) {
/**
* Returns id generator for the specified entity.
* @param entity
- * @return
+ * @return the generator
*/
public DynamoDBIdGenerator getEntityIdGenerator(PersistentEntity entity) {
return entityIdGeneratorMap.get(entity);
@@ -33,16 +33,16 @@
/**
* Returns domain name for the specified primary key value.
*
- * @param id
- * @return
+ * @param id the id
+ * @return the domain name
*/
String resolveTable(String id);
/**
* Returns all domain names for this type of entity. Without sharding this
* list contains always one element.
*
- * @return
+ * @return the names
*/
List<String> getAllTablesForEntity();
}
@@ -408,7 +408,7 @@ private boolean validateProjectionsAndCheckIfCountIsPresent(List<Projection> pro
* (a and b) or c = dis(con(a,b), c) ==> [ [a,b], [c] ] //2 queries
*
* @param criteria
- * @return
+ * @return the results
*/
private List<List<PropertyCriterion>> flattenAndReplaceDisjunction(Junction criteria) {
List<List<PropertyCriterion>> result = new ArrayList<List<PropertyCriterion>>();
@@ -534,7 +534,7 @@ protected static String extractPropertyKey(String propertyName, PersistentEntity
*
* @param entity
* @param propertyName
- * @return
+ * @return the key
*/
protected static String getKey(PersistentEntity entity, String propertyName) {
return extractPropertyKey(propertyName, entity);
@@ -49,7 +49,7 @@
* Same as get but with consistent read flag.
* @param tableName complete name of the table in DynamoDB, will be used as-is
* @param key the key for which to retrieve the data
- * @return
+ * @return null if the item is not found
* @throws org.springframework.dao.DataAccessException
*/
Map<String,AttributeValue> getConsistent(String tableName, Key key) throws DataAccessException;
@@ -74,9 +74,9 @@
* http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/LowLevelJavaItemCRUD.html#PutLowLevelAPIJava
* @param tableName complete name of the table in DynamoDB, will be used as-is
* @param key
- *@param attributes
+ * @param attributes
* @param expectedVersion
- * @throws org.springframework.dao.DataAccessException
+ * @throws org.springframework.dao.DataAccessException
*/
void putItemVersioned(String tableName, Key key, Map<String, AttributeValue> attributes, String expectedVersion, PersistentEntity persistentEntity) throws DataAccessException;
@@ -116,25 +116,25 @@
/**
* Returns true if any item was deleted, in other words if domain was empty it returns false.
* @param tableName complete name of the table in DynamoDB, will be used as-is
- * @return
+ * @return true if any item was deleted
* @throws org.springframework.dao.DataAccessException
*/
boolean deleteAllItems(String tableName) throws DataAccessException;
/**
* Executes scan Dynamo DB operation (note this operation does not scale well with the growth of the table).
* @param max maximum amount of items to return (inclusive)
- * @return
+ * @return the scan results
* @throws org.springframework.dao.DataAccessException
*/
List<Map<String, AttributeValue>> scan(String tableName, Map<String, Condition> filter, int max) throws DataAccessException;
/**
* Executes scan Dynamo DB operation and returns the count of matched items
* (note this operation does not scale well with the growth of the table)
- * @param tableName
- * @param filter
- * @return
+ * @param tableName the table name
+ * @param filter filters
+ * @return the count of matched items
*/
int scanCount(String tableName, Map<String, Condition> filter);
@@ -148,17 +148,17 @@
/**
* Blocking call - internally will wait until the table is successfully created and is in ACTIVE state.
- * @param tableName
- * @param ks
- * @param provisionedThroughput
+ * @param tableName the table name
+ * @param ks the schema
+ * @param provisionedThroughput the throughput
* @throws DataAccessException
*/
void createTable(String tableName, KeySchema ks, ProvisionedThroughput provisionedThroughput) throws DataAccessException;
/**
* Returns table description object containing throughput and key scheme information
- * @param tableName
- * @return
+ * @param tableName the table name
+ * @return the description
* @throws org.springframework.dao.DataAccessException
*/
TableDescription describeTable(String tableName) throws DataAccessException;
Oops, something went wrong.

0 comments on commit 214c9e3

Please sign in to comment.