Class RebindServiceImpl
java.lang.Object
ch.tocco.nice2.netui.impl.bind.entity.RebindServiceImpl
- All Implemented Interfaces:
RebindService
-
Nested Class Summary
Nested classes/interfaces inherited from interface RebindService
RebindService.Scope -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRebindServiceImpl(UriResolver uriResolver, Context context, EntityDefaultValueService entityDefaultValueService) -
Method Summary
Modifier and TypeMethodDescriptionvoidrebind(RebindValue[] values) Overloaded method where scope=null, fillNonNullable=true, fillEntityDefaults=true.voidrebind(RebindValue[] values, @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) Rebinds the given values by finding/creating the affected entities and putting the values on them.rebindAndGetAffectedEntities(RebindValue[] values, RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) Returns all affected entities.rebindAndGetEntity(RebindValue[] values, @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, Predicate<Entity> selectRequiredEntityPredicate) Selects the returned entity with a predicate.rebindAndGetEntity(RebindValue[] values, @Nullable RebindService.Scope scope, String expectedEntityType) Overloaded method where fillNonNullable=true, fillEntityDefaults=true.rebindAndGetEntity(RebindValue[] values, @Nullable RebindService.Scope scope, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) Same asRebindService.rebind(RebindValue[], RebindService.Scope, boolean, boolean)but also returns the "primary" Entity.rebindAndGetEntity(RebindValue[] values, String expectedEntityType) Same asRebindService.rebind(RebindValue[], RebindService.Scope, boolean, boolean)but also returns the "primary" Entity.rebindAndGetEntity(RebindValue[] values, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) Same asRebindService.rebind(RebindValue[], RebindService.Scope, boolean, boolean)but also returns the "primary" Entity.rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, String... expectedEntityTypes) Same asRebindService.rebindAndGetEntity(RebindValue[], String)but returns the first Entity found in one of the expected types.rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, @Nullable RebindService.Scope scope, String... expectedEntityTypes) Overloaded method where fillNonNullable=true, fillEntityDefaults=true.rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, String... expectedEntityTypes) Overloaded method where fillNonNullable=true, fillEntityDefaults=true.
-
Field Details
-
HISTORY
- See Also:
-
-
Constructor Details
-
RebindServiceImpl
public RebindServiceImpl(UriResolver uriResolver, Context context, EntityDefaultValueService entityDefaultValueService)
-
-
Method Details
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, String expectedEntityType) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceSame asRebindService.rebind(RebindValue[], RebindService.Scope, boolean, boolean)but also returns the "primary" Entity.- Specified by:
rebindAndGetEntityin interfaceRebindService- Returns:
- The first Entity of type expectedEntityType. If there could be more then one then you may wish to either use your own listeners to get what you need, or refactor/add functionality.
- Throws:
RebindException- For example if there is no Entity touched of theexpectedEntityType.UnresolvableUriExceptionUriStoreExceptionURISyntaxException
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, String expectedEntityType) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceOverloaded method where fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebindAndGetEntityin interfaceRebindService- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionRebindException- See Also:
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceSame asRebindService.rebind(RebindValue[], RebindService.Scope, boolean, boolean)but also returns the "primary" Entity.- Specified by:
rebindAndGetEntityin interfaceRebindService- Returns:
- The first Entity of type expectedEntityType. If there could be more then one then you may wish to either use your own listeners to get what you need, or refactor/add functionality.
- Throws:
RebindException- For example if there is no Entity touched of theexpectedEntityType.UnresolvableUriExceptionUriStoreExceptionURISyntaxException
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceSame asRebindService.rebind(RebindValue[], RebindService.Scope, boolean, boolean)but also returns the "primary" Entity.- Specified by:
rebindAndGetEntityin interfaceRebindService- Returns:
- The first Entity of type expectedEntityType. If there could be more then one then you may wish to either use your own listeners to get what you need, or refactor/add functionality.
- Throws:
RebindException- For example if there is no Entity touched of theexpectedEntityType.UnresolvableUriExceptionUriStoreExceptionURISyntaxException
-
rebindAndGetEntityOneOfExpectedTypes
public Entity rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, String... expectedEntityTypes) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceOverloaded method where fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebindAndGetEntityOneOfExpectedTypesin interfaceRebindService- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionRebindException- See Also:
-
rebindAndGetEntityOneOfExpectedTypes
public Entity rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, String... expectedEntityTypes) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceOverloaded method where fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebindAndGetEntityOneOfExpectedTypesin interfaceRebindService- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionRebindException- See Also:
-
rebindAndGetEntityOneOfExpectedTypes
public Entity rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, String... expectedEntityTypes) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceSame asRebindService.rebindAndGetEntity(RebindValue[], String)but returns the first Entity found in one of the expected types. You have to manually check of which type the returned entity is.
Hint: This method is made for public forms where it is not clear what entity type will be affected resp. changed. Example: The user can change values of user entity and/or address entity and/or membership entity on the same form.- Specified by:
rebindAndGetEntityOneOfExpectedTypesin interfaceRebindService- Returns:
- The first Entity of one of the type expectedEntityTypes.
- Throws:
RebindException- For example if there is no Entity touched one of theexpectedEntityTypes.UnresolvableUriExceptionUriStoreExceptionURISyntaxException
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, Predicate<Entity> selectRequiredEntityPredicate) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindServiceSelects the returned entity with a predicate. Predicate must be true for exactly one entity in any case.- Specified by:
rebindAndGetEntityin interfaceRebindService- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionRebindException
-
rebindAndGetAffectedEntities
public Set<Entity> rebindAndGetAffectedEntities(RebindValue[] values, RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, ObjectOutdatedException Description copied from interface:RebindServiceReturns all affected entities.- Specified by:
rebindAndGetAffectedEntitiesin interfaceRebindService- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionObjectOutdatedException
-
rebind
public void rebind(RebindValue[] values) throws UnresolvableUriException, UriStoreException, URISyntaxException, ObjectOutdatedException Description copied from interface:RebindServiceOverloaded method where scope=null, fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebindin interfaceRebindService- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionObjectOutdatedException- See Also:
-
rebind
public void rebind(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, ObjectOutdatedException Description copied from interface:RebindServiceRebinds the given values by finding/creating the affected entities and putting the values on them.You can still set up your own listeners (entity-creating etc).
- Specified by:
rebindin interfaceRebindService- Parameters:
scope- Do not passnullfor scope 'copy', it is essential to know that scope.fillNonNullable- Handles this case automatically for you.fillEntityDefaults- Handles this case automatically for you.- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionObjectOutdatedException
-