All Downloads are FREE. Search and download functionalities are using the official Maven repository.

grails.gorm.async.AsyncEntity.groovy Maven / Gradle / Ivy

The newest version!
package grails.gorm.async

import groovy.transform.CompileStatic

import org.grails.datastore.gorm.GormEnhancer
import org.grails.datastore.gorm.GormEntity
import org.grails.datastore.gorm.async.GormAsyncStaticApi

/**
 * Adds Grails Async features to an entity that implements this trait, including the ability to run GORM tasks in a separate thread
 *
 * @author Graeme Rocher
 * @since 6.1
 */
@CompileStatic
trait AsyncEntity extends GormEntity {

    /**
     * @return The async version of the GORM static API
     */
    static GormAsyncStaticApi getAsync() {
        return new GormAsyncStaticApi(GormEnhancer.findStaticApi(this))
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy