KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > ejb > cmp3 > xml > columns > XMLJoinColumn


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.ejb.cmp3.xml.columns;
23
24 import org.w3c.dom.Node JavaDoc;
25
26 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLHelper;
27 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLConstants;
28
29 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataJoinColumn;
30
31 /**
32  * Object to hold onto xml join column metadata in a TopLink database fields.
33  *
34  * @author Guy Pelletier
35  * @since TopLink 10.1.3/EJB 3.0 Preview
36  */

37 public class XMLJoinColumn extends MetadataJoinColumn {
38     /**
39      * INTERNAL:
40      * Called for association override.
41      */

42     public XMLJoinColumn(Node JavaDoc node, XMLHelper helper) {
43         // Process the primary key field metadata.
44
m_pkField.setName(helper.getNodeValue(node, XMLConstants.ATT_REFERENCED_COLUMN_NAME, DEFAULT_REFERENCED_COLUMN_NAME));
45         
46         // Process the foreign key field metadata.
47
m_fkField.setName(helper.getNodeValue(node, XMLConstants.ATT_NAME, DEFAULT_NAME));
48         m_fkField.setTableName(helper.getNodeValue(node, XMLConstants.ATT_TABLE, DEFAULT_TABLE));
49         m_fkField.setUnique(helper.getNodeValue(node, XMLConstants.ATT_UNIQUE, DEFAULT_UNIQUE));
50         m_fkField.setNullable(helper.getNodeValue(node, XMLConstants.ATT_NULLABLE, DEFAULT_NULLABLE));
51         m_fkField.setUpdatable(helper.getNodeValue(node, XMLConstants.ATT_UPDATABLE, DEFAULT_UPDATABLE));
52         m_fkField.setInsertable(helper.getNodeValue(node, XMLConstants.ATT_INSERTABLE, DEFAULT_INSERTABLE));
53         m_fkField.setColumnDefinition(helper.getNodeValue(node, XMLConstants.ATT_COLUMN_DEFINITION, DEFAULT_COLUMN_DEFINITION));
54     }
55     
56     /**
57      * INTERNAL:
58      */

59     public boolean loadedFromXML() {
60         return true;
61     }
62 }
63
Popular Tags