Skip to contentPackage: ChangeRecord
ChangeRecord
Coverage
1: /*
2: * JOPA
3: * Copyright (C) 2023 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.jopa.sessions;
19:
20: import cz.cvut.kbss.jopa.model.metamodel.FieldSpecification;
21:
22: /**
23: * Objects of classes implementing this interface represent a change of one attribute of an entity class. Objects store
24: * only the new value, old value is in the original and it is not needed.
25: */
26: public interface ChangeRecord {
27:
28: /**
29: * Returns the new value of the attribute.
30: *
31: * @return Object
32: */
33: Object getNewValue();
34:
35: /**
36: * Sets the new value of the attribute in case this change record needs to be updated.
37: *
38: * @param value The value to set
39: */
40: void setNewValue(Object value);
41:
42: /**
43: * Gets the attribute to which this change record is bound.
44: *
45: * @return the attribute
46: */
47: FieldSpecification<?, ?> getAttribute();
48:
49: /**
50: * Whether this change record prevents caching of the instance on which the change is applied.
51: *
52: * @return Whether this change record prevents caching
53: */
54: boolean doesPreventCaching();
55:
56: /**
57: * Marks this change record to prevent caching.
58: *
59: * @see #doesPreventCaching()
60: */
61: void preventCaching();
62: }