Transient Fields
This is the manual for older MicroStream versions (Version < 5.0).
The new documentation (Version >= 5.0) is located at:
The default MicroStream implementation fully supports the Java transient field modifier. Class members marked transient will not be persisted.
1
public class User
2
{
3
private String username;
4
5
//do not persist the users password
6
private transient String password;
7
}
Copied!
It is possible to override the default behavior by implementing a custom PersistenceFieldEvaluator.
1
PersistenceFieldEvaluator fieldEvaluator =
2
(clazz, field) -> !field.getName().startsWith("_");
3
4
EmbeddedStorageManager storage = EmbeddedStorage.Foundation()
5
.onConnectionFoundation(
6
c -> c.setFieldEvaluatorPersistable(fieldEvaluator)
7
)
8
.createEmbeddedStorageManager()
9
.start();
Copied!
Last modified 3mo ago
Export as PDF
Copy link