org.eclipse.persistence.internal.jpa.AttributeNodeImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eclipselink Show documentation
Show all versions of eclipselink Show documentation
EclipseLink build based upon Git transaction 346465e
/*******************************************************************************
* Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* 09 Jan 2013-2.5 Gordon Yorke
* - 397772: JPA 2.1 Entity Graph Support
******************************************************************************/
package org.eclipse.persistence.internal.jpa;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.AttributeNode;
import javax.persistence.Subgraph;
/**
* Concrete JPA AttributeNode class. For this implementation the AttributeNode includes information from live
* AttributeItems.
*/
public class AttributeNodeImpl implements AttributeNode{
protected String currentAttribute;
protected Map subgraphs;
protected Map keySubgraphs;
protected AttributeNodeImpl(){
}
protected AttributeNodeImpl(String attribute){
this.currentAttribute = attribute;
}
public String getAttributeName() {
return currentAttribute;
}
public Map getSubgraphs() {
if (this.subgraphs == null){
this.subgraphs = new HashMap();
}
return this.subgraphs;
}
public Map getKeySubgraphs() {
if (this.keySubgraphs == null){
this.keySubgraphs = new HashMap();
}
return this.keySubgraphs;
}
public void addSubgraph(EntityGraphImpl entityGraphImpl) {
if (this.subgraphs == null){
this.subgraphs = new HashMap();
}
this.subgraphs.put(entityGraphImpl.getClassType(), entityGraphImpl);
}
public void addKeySubgraph(EntityGraphImpl entityGraphImpl) {
if (this.keySubgraphs == null){
this.keySubgraphs = new HashMap();
}
this.keySubgraphs.put(entityGraphImpl.getClassType(), entityGraphImpl);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy