Documentation changes
- Document changes to JPA Entity model, persistence facilities and related new interfaces and services. - Relates to #429 - Relates to #476
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,9 +16,11 @@
|
||||
package org.springframework.statemachine.data.redis.docs;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.statemachine.data.StateMachineRepository;
|
||||
import org.springframework.statemachine.data.StateRepository;
|
||||
import org.springframework.statemachine.data.TransitionRepository;
|
||||
import org.springframework.statemachine.data.redis.RedisRepositoryState;
|
||||
import org.springframework.statemachine.data.redis.RedisRepositoryStateMachine;
|
||||
import org.springframework.statemachine.data.redis.RedisRepositoryTransition;
|
||||
|
||||
public class DocsRedisRepositorySampleTests1 {
|
||||
@@ -76,4 +78,23 @@ public class DocsRedisRepositorySampleTests1 {
|
||||
}
|
||||
// end::snippetB[]
|
||||
}
|
||||
|
||||
public static class Config3 {
|
||||
|
||||
// tag::snippetC[]
|
||||
@Autowired
|
||||
StateMachineRepository<RedisRepositoryStateMachine> stateMachineRepository;
|
||||
|
||||
void persist() {
|
||||
|
||||
RedisRepositoryStateMachine machine = new RedisRepositoryStateMachine();
|
||||
machine.setMachineId("machine");
|
||||
machine.setState("S1");
|
||||
// raw byte[] representation of a context
|
||||
machine.setStateMachineContext(new byte[] { 0 });
|
||||
|
||||
stateMachineRepository.save(machine);
|
||||
}
|
||||
// end::snippetC[]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user