Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ public interface GrailsApplication extends ApplicationContextAware {
/**
* The name of the class that provides configuration
*/
@Deprecated
@Deprecated(forRemoval = true)
String CONFIG_CLASS = "Config";
/**
* The name of the DataSource class
*/
@Deprecated
@Deprecated(forRemoval = true)
String DATA_SOURCE_CLASS = "DataSource";
/**
* The name of the project metadata file
*/
@Deprecated
@Deprecated(forRemoval = true)
String PROJECT_META_FILE = "application.properties";
/**
* The name of the transaction manager bean
Expand Down
2 changes: 1 addition & 1 deletion grails-core/src/main/groovy/grails/util/Mixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
@GroovyASTTransformationClass("org.grails.compiler.injection.MixinTransformation")
@Deprecated
@Deprecated(since = "7.0", forRemoval = true)
public @interface Mixin {
Class<?>[] value ();
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package grails.util
* @since 2.3.8
* @deprecated Mixins are deprecated in Groovy 4.0 and will be removed in a future version of Grails.
*/
@Deprecated
@Deprecated(since = '7.0', forRemoval = true)
interface MixinTargetAware<T> {

void setTarget(T targetObject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @since 2.0
* @deprecated Use org.grails.datastore.gorm.validation.constraints.eval.ConstraintsEvaluator instead
*/
@Deprecated
@Deprecated(since = "3.3", forRemoval = true)
public interface ConstraintsEvaluator {

String PROPERTY_NAME = "constraints";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void performInjectionOnArtefactType(SourceUnit sourceUnit, ClassNode cNod
performInjection(sourceUnit, cNode, injectors);
}

@Deprecated
@Deprecated(forRemoval = true)
public static void doPerformInjectionOnArtefactType(SourceUnit sourceUnit, ClassNode cNode, String artefactType) {
List<ClassInjector> injectors = findInjectors(artefactType, GrailsAwareInjectionOperation.getClassInjectors());
performInjection(sourceUnit, cNode, injectors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* @since 2.1.2
* @deprecated Mixins are deprecated in Groovy 4 and will be removed in a future version of Grails
*/
@Deprecated
@Deprecated(since = "7.0", forRemoval = true)
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
public class MixinTransformation implements ASTTransformation, TransformWithPriority {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class PropertyConfig extends Property {
*
* @deprecated Use updatable instead
*/
@Deprecated
@Deprecated // Cheap to keep around for backwards compatibility
boolean getUpdateable() {
return updatable
}
Expand All @@ -109,7 +109,7 @@ class PropertyConfig extends Property {
* Whether or not this column is updatable by hibernate
* @deprecated Use updatable instead
*/
@Deprecated
@Deprecated // Cheap to keep around for backwards compatibility
void setUpdateable(boolean updateable) {
this.updatable = updateable
}
Expand Down Expand Up @@ -444,6 +444,7 @@ class PropertyConfig extends Property {
}

String toString() {
// TODO(Grails 8): updateable -> updatable
"property[type:$type, lazy:$lazy, columns:$columns, insertable:${insertable}, updateable:${updatable}]"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ class HibernateMappingBuilderTests {
}

@Test
void testUpdatablePropertyConfig() {
void testUpdateablePropertyConfig() {
def builder = new HibernateMappingBuilder("Foo")
def mapping = builder.evaluate {
firstName updateable:true
Expand All @@ -852,6 +852,17 @@ class HibernateMappingBuilderTests {
assertFalse mapping.getPropertyConfig('lastName').updateable
}

@Test
void testUpdatablePropertyConfig() {
def builder = new HibernateMappingBuilder("Foo")
def mapping = builder.evaluate {
firstName updatable:true
lastName updatable:false
}
assertTrue mapping.getPropertyConfig('firstName').updatable
assertFalse mapping.getPropertyConfig('lastName').updatable
}

@Test
void testDefaultValue() {
def builder = new HibernateMappingBuilder("Foo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ trait MongoEntity<D> implements GormEntity<D>, DynamicAttributes {
* @param instance The instance
* @return The DBObject instance
*/
@Deprecated
@Deprecated(forRemoval = true)
Document getDbo() {
AbstractMongoSession session = (AbstractMongoSession) AbstractDatastore.retrieveSession(MongoDatastore)
// check first for embedded cached entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import grails.gorm.api.GormInstanceOperations
* Instance methods for GORM for MongoDB
* @author Graeme Rocher
* @since 6.0
* @deprecated The sole getDbo method is deprecated and will be removed in a future release.
* Use dynamic properties instead to access the underlying Document.
*/
@Deprecated(forRemoval = true)
interface MongoInstanceOperations<D> extends GormInstanceOperations<D> {

/**
Expand All @@ -37,6 +40,6 @@ interface MongoInstanceOperations<D> extends GormInstanceOperations<D> {
* @param instance The instance
* @return The DBObject instance
*/
@Deprecated
@Deprecated(forRemoval = true)
Document getDbo(D instance)
}
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class MongoStaticApi<D> extends GormStaticApi<D> implements MongoAllOperations<D
}

@Override
@Deprecated
@Deprecated(forRemoval = true)
Document getDbo(D instance) {
return ((MongoEntity) instance).dbo
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ class GormEnhancer implements Closeable {
}

/**
* @deprecated Use #createNamedQuery(entity, queryName) instead
* @deprecated Named queries are deprecated, use where queries instead
*/
@Deprecated
@Deprecated(since = '3.2', forRemoval = true)
static GormQueryOperations findNamedQuery(Class entity, String queryName) {
return createNamedQuery(entity, queryName)
}
Expand All @@ -221,9 +221,11 @@ class GormEnhancer implements Closeable {
*
* @param entity The entity name
* @param queryName The query name
* @deprecated Named queries are deprecated, use where queries instead
*
* @return The named query or null if it doesn't exist
*/
@Deprecated(since = '7.1', forRemoval = true)
static GormQueryOperations createNamedQuery(Class entity, String queryName) {
createNamedQuery(entity, queryName, null)
}
Expand All @@ -233,9 +235,11 @@ class GormEnhancer implements Closeable {
*
* @param entity The entity name
* @param queryName The query name
* @deprecated Named queries are deprecated, use where queries instead
*
* @return The named query or null if it doesn't exist
*/
@Deprecated(since = '7.1', forRemoval = true)
static GormQueryOperations createNamedQuery(Class entity, String queryName, Object... args) {
def className = entity.getName()
def namedQueries = NAMED_QUERIES.get(className)
Expand All @@ -262,6 +266,10 @@ class GormEnhancer implements Closeable {
return buildNamedCriteriaProxy(entity, namedQueries, queryName, args)
}

/**
* @deprecated Named queries are deprecated, use where queries instead
*/
@Deprecated(since = '7.1', forRemoval = true)
private static NamedCriteriaProxy buildNamedCriteriaProxy(Class entity, Map<String, Closure> namedQueries, String queryName, Object... args) {
NamedCriteriaProxy namedCriteriaProxy = null
GormStaticApi staticApi = findStaticApi(entity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ trait GormEntity<D> implements GormValidateable, DirtyCheckable, GormEntityApi<D
* @deprecated Named queries are deprecated, use where queries instead
*/
@Generated
@Deprecated
@Deprecated(since = '3.2', forRemoval = true)
static GormQueryOperations<D> getNamedQuery(String queryName) {
GormEnhancer.createNamedQuery(this, queryName)
}
Expand All @@ -1472,7 +1472,7 @@ trait GormEntity<D> implements GormValidateable, DirtyCheckable, GormEntityApi<D
* @deprecated Named queries are deprecated, use where queries instead
*/
@Generated
@Deprecated
@Deprecated(since = '3.2', forRemoval = true)
static GormQueryOperations<D> getNamedQuery(String queryName, Object...args) {
GormEnhancer.createNamedQuery(this, queryName, args)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.grails.datastore.mapping.model.PersistentEntity
* @since 5.0
* @deprecated Use where queries instead
*/
@Deprecated
@Deprecated(forRemoval = true)
class NamedCriteriaProxy<D> implements GormQueryOperations<D> {

final Closure criteriaClosure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import groovy.transform.CompileStatic
*
* @author Graeme Rocher
* @author Jeff Brown
* @deprecated Named queries are deprecated, use where queries instead
*/
@Deprecated(since = '7.1', forRemoval = true)
class NamedQueriesBuilder {

private boolean initialized = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ interface Constrained {
* @return Whether the value should be displayed (for backwards compatibility)
* @deprecated Use {@link #getDisplayType()} instead for more granular control
*/
@Deprecated
@Deprecated(since = '7.1')
boolean isDisplay()

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ import org.grails.datastore.mapping.model.config.GormProperties
class Entity<P extends Property> {

/**
* @deprecated Use {@link ConnectionSource#DEFAULT} instead
* @deprecated Use {@link ConnectionSource#ALL} instead
*/
@Deprecated
@Deprecated(forRemoval = true)
public static final String ALL_DATA_SOURCES = ConnectionSource.ALL

/**
* @deprecated Use {@link ConnectionSource#ALL} instead
* @deprecated Use {@link ConnectionSource#DEFAULT} instead
*/
@Deprecated
@Deprecated(forRemoval = true)
public static final String DEFAULT_DATA_SOURCE = ConnectionSource.DEFAULT

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public boolean isDirty(Object instance) {
}

if (instance instanceof DirtyCheckable) {
return ((DirtyCheckable) instance).hasChanged() || DirtyCheckingSupport.areAssociationsDirty(this, persister.getPersistentEntity(), instance);
return ((DirtyCheckable) instance).hasChanged() || DirtyCheckingSupport.areAssociationsDirty(persister.getPersistentEntity(), instance);
}

if (!(persister instanceof NativeEntryEntityPersister)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DirtyCheckingSupport {
* @return True if they are
* @deprecated Use {@link #areAssociationsDirty(org.grails.datastore.mapping.model.PersistentEntity, java.lang.Object)} instead
*/
@Deprecated
@Deprecated(forRemoval = true)
static boolean areAssociationsDirty(Session session, PersistentEntity entity, Object instance) {
areAssociationsDirty(entity, instance)
}
Expand Down
6 changes: 3 additions & 3 deletions grails-doc/src/en/guide/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1760,10 +1760,10 @@ include::ref/Database Mapping/table.adoc[]

include::ref/Database Mapping/type.adoc[]

[[ref-database-mapping-updateable]]
==== updateable
[[ref-database-mapping-updatable]]
==== updatable

include::ref/Database Mapping/updateable.adoc[]
include::ref/Database Mapping/updatable.adoc[]

[[ref-database-mapping-version]]
==== version
Expand Down
4 changes: 2 additions & 2 deletions grails-doc/src/en/guide/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,10 @@ include::ref/Database Mapping/table.adoc[]

include::ref/Database Mapping/type.adoc[]

[[ref-database-mapping-updateable]]
[[ref-database-mapping-updatable]]
==== updateable

include::ref/Database Mapping/updateable.adoc[]
include::ref/Database Mapping/updatable.adoc[]

[[ref-database-mapping-version]]
==== version
Expand Down
4 changes: 2 additions & 2 deletions grails-doc/src/en/ref/Database Mapping/insertable.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Book {
static mapping = {
author insertable: false
author updateable: false
author updatable: false
}
}
----
Expand All @@ -54,7 +54,7 @@ Usage: `association_name(insertable: boolean)`

Useful in general where you don't want to set an initial value (or include the column in the generated SQL) during an initial `save()`.

In particular this is useful for one-to-many relationships. For example when you store the foreign key in the 'child' table, it's often efficient to save the child using only the foreign key of the parent. You do this by setting the parent object (and the parent foreign key) in the 'child' entity. Setting the attributes insertable:false and updateable:false for the 'belongsTo' parent object lets you insert and update using only the foreign key.
In particular this is useful for one-to-many relationships. For example when you store the foreign key in the 'child' table, it's often efficient to save the child using only the foreign key of the parent. You do this by setting the parent object (and the parent foreign key) in the 'child' entity. Setting the attributes insertable:false and updatable:false for the 'belongsTo' parent object lets you insert and update using only the foreign key.

[source,groovy]
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ under the License.
////


== updateable
== updatable



Expand All @@ -41,7 +41,7 @@ class Book {

static mapping = {
author insertable: false
author updateable: false
author updatable: false
}
}
----
Expand All @@ -50,15 +50,15 @@ class Book {
=== Description


Usage: `association_name(updateable: boolean)`
Usage: `association_name(updatable: boolean)`

Useful in general where you don't want to update a value (or include the column in the generated SQL) during a `save()`.

In particular this is useful for one-to-many relationships. For example when you store the foreign key in the 'child' table, it's often efficient to save the child using only the foreign key of the parent. You do this by setting the parent object (and the parent foreign key) in the 'child' entity. Setting the attributes insertable:false and updateable:false for the 'belongsTo' parent object lets you insert and update using only the foreign key.
In particular this is useful for one-to-many relationships. For example when you store the foreign key in the 'child' table, it's often efficient to save the child using only the foreign key of the parent. You do this by setting the parent object (and the parent foreign key) in the 'child' entity. Setting the attributes insertable:false and updatable:false for the 'belongsTo' parent object lets you insert and update using only the foreign key.

[source,groovy]
----
static mapping = {
author updateable: false
author updatable: false
}
----
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class GrailsDomainClassAutoConfiguration {

@Lazy
@Bean(name = ConstraintsEvaluator.BEAN_NAME)
@Deprecated(since = '7.1', forRemoval = true)
ConstraintEvaluatorAdapter constraintsEvaluator(DefaultConstraintEvaluatorFactoryBean validateableConstraintsEvaluator) {
new ConstraintEvaluatorAdapter(validateableConstraintsEvaluator.object)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import grails.validation.ConstrainedDelegate;
import grails.validation.ConstraintsEvaluator;

@Deprecated(since = "7.1", forRemoval = true)
public class ConstraintEvaluatorAdapter implements ConstraintsEvaluator {

private final org.grails.datastore.gorm.validation.constraints.eval.ConstraintsEvaluator constraintsEvaluator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ import grails.events.Events
* @since 3.0
* @deprecated Here for compatibility, do not use directly
*/
@Deprecated
@Deprecated(since = '3.3', forRemoval = true)
trait Service extends Events {}
Loading
Loading