Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt
package org.litesoft.orsup.base;

import java.util.*;

import org.litesoft.bo.*;
import org.litesoft.changemanagement.ServerStateChange.*;
import org.litesoft.encryption.symmetric.*;
import org.litesoft.orsup.selection.nonpublic.*;
import org.litesoft.orsup.transact.*;

public interface PersistentObject<T extends PersistentObject> extends WhereClauseToSQLable,
                                                                      Comparable<PersistentObject>
{
    public SymmetricEncryptorManager getEncryptorManager();

    /**
     * @return either the Transaction's finder if in a Transaction of the DataStore's finder
     */
    public Finder getFinder();

    public NonTransactionalFinder<?> getNonTransactionalFinder();

    public Transaction getTransaction();

    public String getObjectName();

    public String getRegisteredName();

    public PersistentObjectUniqueKey getPersistentObjectUniqueKey();

    public PersistentObjectURL getPersistentObjectURL();

    public ObjectHandle getObjectHandle();

    public String getDisplayValue();

    public boolean isImmortal();

    public boolean isUpdatable();

    public void requestDelete();

    public boolean isDeleteRequested();

    public boolean isNew();

    public boolean isDirty();

    public void forceUpdate();

    public void forceChangeNotification();

    public boolean isForcedChangeNotification();

    public int getChangeNumber();

    public int numberOfAttributeChanged();

    public boolean isAnyAttributeChanged();

    public String[] getChangedAttributeNames();

    public Object getOriginalValueFor( String pAttributeName );

    public void rehydationComplete();

    /**
     * @return is Attribute exists && if it has changed
     */
    public boolean isAttributeChanged( String pAttributeName );

    public boolean isAttributeChanged( AttributeAccessorSCD pAttributeAccessorSCD );

    public Object getAttributeValue( String pAttributeName )
            throws NoSuchElementException;

    public void setAttributeValue( String pAttributeName, Object pValue )
            throws NoSuchElementException, AttributeIllegalArgumentException;

    public void addToAttributeSet( String pAttributeName, PersistentObject<?> pPOtoAdd )
            throws NoSuchElementException, AttributeIllegalArgumentException;

    public void removeFromAttributeSet( String pAttributeName, PersistentObject<?> pPOtoRemove )
            throws NoSuchElementException, AttributeIllegalArgumentException;

    /**
     * @return non-Transactional copy of the latest version of this PO, or Null if the PO is in a Transaction and isNew() OR has been deleted
     */
    public T refreshNonTransactionally();

    /**
     * Refresh this PO into the provided transaction.
     *
     * @param pTransaction !null
     *
     * @return Transactional copy of the latest version read via Transaction, or Null if the PO is in another Transaction and isNew() OR has been deleted
     *
     * @throws UnsupportedOperationException - if the PO is already in the Transaction
     */
    public T refreshInto( Transaction pTransaction )
            throws UnsupportedOperationException;

    /**
     * Copy this PO (without re-fetching it) into the provided transaction.
     *
     * @param pTransaction !null
     *
     * @return copy of this PO
     */
    public T copyInto( Transaction pTransaction )
            throws UnsupportedOperationException;

    public MetaDataForPO getMetaDataForPO();

    /**
     * If the PO is in a Transaction, this method returns the appropriate StateChange.Action. If the PO is not
     * in a Transaction it returns null.
     *
     * @return DELETED if isDeleteRequest(); CREATED if isNew(); UPDATED if getTransaction() != null;
     *         otherwise null.
     */
    public Action makeStateChangeAction();

    public boolean willTossFromTransactionCommit();
}

Commits for litesoft/trunk/Java/core/Server/src/org/litesoft/orsup/base/PersistentObject.java

Diff revisions: vs.
Revision Author Commited Message
220 Diff Diff GeorgeS picture GeorgeS Thu 19 May, 2011 22:32:05 +0000
49 Diff Diff GeorgeS picture GeorgeS Mon 12 Apr, 2010 02:59:10 +0000

License Text

2 GeorgeS picture GeorgeS Sun 07 Feb, 2010 12:50:58 +0000