save

open fun <E : Any> save(entity: E, block: KSaveCommandDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an entity object

Return

The saved result for single object

Parameters

entity

The saved entity object.

Note: The jimmer entity is not POJO, it can easily express data structures of arbitrary shape, you can use it to save data structures of arbitrary shape.

Unlike most JVM ORMs, Jimmer does not sepcified the shape of the saved data structure by using configuration such as insertable, updatable or cascade; instead, it uses the dynamic nature of entity object itself to describe the shape of saved data structure, without prior design

Unspecified properties will be ignored, only the specified properties (whether null or not) will be saved. In addition to objects with only id property, any associated objects will result in deeper recursive saves.

  • The default value of the SaveMode of aggregate-root is SaveMode.UPSERT, it can be overwritten by the lambda represented by the parameter block

  • The default value of the AssociatedSaveMode of associated objects is AssociatedSaveMode.REPLACE, it can be overwritten by the lambda represented by the parameter block

block

An optional lambda to add additional configuration.

E

The type of saved entity


open fun <E : Any> save(entity: E, mode: SaveMode, associatedMode: AssociatedSaveMode = AssociatedSaveMode.REPLACE, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an entity object

Return

The saved result for single object

Parameters

entity

The saved entity object.

Note: The jimmer entity is not POJO, it can easily express data structures of arbitrary shape, you can use it to save data structures of arbitrary shape.

Unlike most JVM ORMs, Jimmer does not sepcified the shape of the saved data structure by using configuration such as insertable, updatable or cascade; instead, it uses the dynamic nature of entity object itself to describe the shape of saved data structure, without prior design

Unspecified properties will be ignored, only the specified properties (whether null or not) will be saved. In addition to objects with only id property, any associated objects will result in deeper recursive saves.

mode

The save mode of aggregate-root

associatedMode

The save mode of associated-objects. This parameter is optional, its default value is AssociatedSaveMode.REPLACE

block

An optional lambda to add additional configuration. In addition to setting the SaveMode of aggregate root and the default value of the AssociatedSaveMode of associated objects, you can add any other configuration.

E

The type of saved entity


open fun <E : Any> save(entity: E, associatedMode: AssociatedSaveMode, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an entity object

Return

The saved result for single object

Parameters

entity

The saved entity object.

Note: The jimmer entity is not POJO, it can easily express data structures of arbitrary shape, you can use it to save data structures of arbitrary shape.

Unlike most JVM ORMs, Jimmer does not sepcified the shape of the saved data structure by using configuration such as insertable, updatable or cascade; instead, it uses the dynamic nature of entity object itself to describe the shape of saved data structure, without prior design

Unspecified properties will be ignored, only the specified properties (whether null or not) will be saved. In addition to objects with only id property, any associated objects will result in deeper recursive saves.

The SaveMode of aggregate-root is SaveMode.UPSERT

associatedMode

The save mode of associated-objects.

block

An optional lambda to add additional configuration. In addition to setting the SaveMode of aggregate root and the default value of the AssociatedSaveMode of associated objects, you can add any other configuration.

E

The type of saved entity


open fun <E : Any> save(input: Input<E>, block: KSaveCommandDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an input DTO

Return

The saved result for single object

Parameters

input

The saved input DTO.

In terms of internal mechanisms, any type of Input DTO is automatically converted into an entity object of the same type

Note: The jimmer entity is not POJO, it can easily express data structures of arbitrary shape, you can use it to save data structures of arbitrary shape.

Unlike most JVM ORMs, Jimmer does not sepcified the shape of the saved data structure by using configuration such as insertable, updatable or cascade; instead, it uses the dynamic nature of entity object itself to describe the shape of saved data structure, without prior design

Unspecified properties will be ignored, only the specified properties (whether null or not) will be saved. In addition to objects with only id property, any associated objects will result in deeper recursive saves.

  • The default value of the SaveMode of aggregate-root is SaveMode.UPSERT, it can be overwritten by the lambda represented by the parameter block

  • The default value of the AssociatedSaveMode of associated objects is AssociatedSaveMode.REPLACE, it can be overwritten by the lambda represented by the parameter block

block

An optional lambda to add additional configuration.

E

The type of saved entity


open fun <E : Any> save(input: Input<E>, mode: SaveMode, associatedMode: AssociatedSaveMode = AssociatedSaveMode.REPLACE, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an input DTO

Return

The saved result for single object

Parameters

input

The saved input DTO.

In terms of internal mechanisms, any type of Input DTO is automatically converted into an entity object of the same type

Note: The jimmer entity is not POJO, it can easily express data structures of arbitrary shape, you can use it to save data structures of arbitrary shape.

Unlike most JVM ORMs, Jimmer does not sepcified the shape of the saved data structure by using configuration such as insertable, updatable or cascade; instead, it uses the dynamic nature of entity object itself to describe the shape of saved data structure, without prior design

Unspecified properties will be ignored, only the specified properties (whether null or not) will be saved. In addition to objects with only id property, any associated objects will result in deeper recursive saves.

mode

The save mode of aggregate-root

associatedMode

The save mode of associated-objects. This parameter is optional, its default value is AssociatedSaveMode.REPLACE

block

An optional lambda to add additional configuration. In addition to setting the SaveMode of aggregate root and the default value of the AssociatedSaveMode of associated objects, you can add any other configuration.

E

The type of saved entity


open fun <E : Any> save(input: Input<E>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.REPLACE, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an input DTO

Return

The saved result for single object

Parameters

input

The saved input DTO.

In terms of internal mechanisms, any type of Input DTO is automatically converted into an entity object of the same type

Note: The jimmer entity is not POJO, it can easily express data structures of arbitrary shape, you can use it to save data structures of arbitrary shape.

Unlike most JVM ORMs, Jimmer does not sepcified the shape of the saved data structure by using configuration such as insertable, updatable or cascade; instead, it uses the dynamic nature of entity object itself to describe the shape of saved data structure, without prior design

Unspecified properties will be ignored, only the specified properties (whether null or not) will be saved. In addition to objects with only id property, any associated objects will result in deeper recursive saves.

The SaveMode of aggregate-root is SaveMode.UPSERT

associatedMode

The save mode of associated-objects. This parameter is optional, its default value is AssociatedSaveMode.REPLACE

block

An optional lambda to add additional configuration. In addition to setting the SaveMode of aggregate root and the default value of the AssociatedSaveMode of associated objects, you can add any other configuration.

E

The type of saved entity