01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency;
10:
11: import com.completex.objective.components.persistency.core.impl.LinkIterator;
12:
13: import java.sql.SQLException;
14:
15: /**
16: * Represents Link tree
17: *
18: * @author Gennady Krizhevsky
19: */
20: public interface Parent {
21: /**
22: *
23: * @return <code>Link</code> corresponding to the parent itself
24: */
25: Link toLink();
26:
27: /**
28: *
29: * @return linkIterator
30: */
31: LinkIterator linkIterator();
32:
33: /**
34: *
35: * @return true if this parent has children
36: */
37: boolean hasChildren();
38:
39: /**
40: *
41: * Get link by name and return its result
42: *
43: * @param name
44: * @return ChildObject
45: * @throws OdalRuntimePersistencyException if any error happens
46: */
47: Object getChildObject(String name);
48:
49: /**
50: * Get link by name and set its result
51: *
52: * @param name
53: * @param value
54: * @throws OdalRuntimePersistencyException if any error happens
55: */
56: void setChildObject(String name, Object value);
57:
58: /**
59: * Identity key not necessarily coinciding with set of fields mapped to primary key columns
60: *
61: * @return key of this object
62: */
63: Object toKey();
64:
65: /**
66: *
67: * @return inlineLinks
68: */
69: Link[] inlineLinks();
70:
71: /**
72: * Add child link with specific name
73: *
74: * @see Link
75: * @param link
76: * @throws NullPointerException if link has no name set
77: */
78: void addChild(Link link);
79:
80: /**
81: * Returns child link by name. If child is not found - retruns null
82: *
83: * @return child link by name
84: */
85: Link child(String name);
86: }
|