The mapping for a component, composite element,
composite identifier, etc.
| Method from org.hibernate.mapping.Component Detail: |
public Object accept(ValueVisitor visitor) {
return visitor.accept(this);
}
|
public void addColumn(Column column) {
throw new UnsupportedOperationException("Cant add a column to a component");
}
|
public void addProperty(Property p) {
properties.add(p);
}
|
public void addTuplizer(EntityMode entityMode,
String implClassName) {
if ( tuplizerImpls == null ) {
tuplizerImpls = new HashMap();
}
tuplizerImpls.put( entityMode, implClassName );
}
|
public boolean[] getColumnInsertability() {
boolean[] result = new boolean[ getColumnSpan() ];
Iterator iter = getPropertyIterator();
int i=0;
while ( iter.hasNext() ) {
Property prop = (Property) iter.next();
boolean[] chunk = prop.getValue().getColumnInsertability();
if ( prop.isInsertable() ) {
System.arraycopy(chunk, 0, result, i, chunk.length);
}
i+=chunk.length;
}
return result;
}
|
public Iterator getColumnIterator() {
Iterator[] iters = new Iterator[ getPropertySpan() ];
Iterator iter = getPropertyIterator();
int i=0;
while ( iter.hasNext() ) {
iters[i++] = ( (Property) iter.next() ).getColumnIterator();
}
return new JoinedIterator(iters);
}
|
public int getColumnSpan() {
int n=0;
Iterator iter = getPropertyIterator();
while ( iter.hasNext() ) {
Property p = (Property) iter.next();
n+= p.getColumnSpan();
}
return n;
}
|
public boolean[] getColumnUpdateability() {
boolean[] result = new boolean[ getColumnSpan() ];
Iterator iter = getPropertyIterator();
int i=0;
while ( iter.hasNext() ) {
Property prop = (Property) iter.next();
boolean[] chunk = prop.getValue().getColumnUpdateability();
if ( prop.isUpdateable() ) {
System.arraycopy(chunk, 0, result, i, chunk.length);
}
i+=chunk.length;
}
return result;
}
|
public Class getComponentClass() throws MappingException {
try {
return ReflectHelper.classForName(componentClassName);
}
catch (ClassNotFoundException cnfe) {
throw new MappingException("component class not found: " + componentClassName, cnfe);
}
}
|
public String getComponentClassName() {
return componentClassName;
}
|
public MetaAttribute getMetaAttribute(String attributeName) {
return metaAttributes==null?null:(MetaAttribute) metaAttributes.get(attributeName);
}
|
public Map getMetaAttributes() {
return metaAttributes;
}
|
public String getNodeName() {
return nodeName;
}
|
public PersistentClass getOwner() {
return owner;
}
|
public String getParentProperty() {
return parentProperty;
}
|
public Property getProperty(String propertyName) throws MappingException {
Iterator iter = getPropertyIterator();
while ( iter.hasNext() ) {
Property prop = (Property) iter.next();
if ( prop.getName().equals(propertyName) ) {
return prop;
}
}
throw new MappingException("component property not found: " + propertyName);
}
|
public Iterator getPropertyIterator() {
return properties.iterator();
}
|
public int getPropertySpan() {
return properties.size();
}
|
public String getRoleName() {
return roleName;
}
|
public String getTuplizerImplClassName(EntityMode mode) {
// todo : remove this once ComponentMetamodel is complete and merged
if ( tuplizerImpls == null ) {
return null;
}
return ( String ) tuplizerImpls.get( mode );
}
|
public Map getTuplizerMap() {
if ( tuplizerImpls == null ) {
return null;
}
return java.util.Collections.unmodifiableMap( tuplizerImpls );
}
|
public Type getType() throws MappingException {
// added this caching as I noticed that getType() is being called multiple times...
if ( type == null ) {
type = buildType();
}
return type;
}
|
public boolean hasPojoRepresentation() {
return componentClassName!=null;
}
|
public boolean isDynamic() {
return dynamic;
}
|
public boolean isEmbedded() {
return embedded;
}
|
public boolean isKey() {
return isKey;
}
|
public void setComponentClassName(String componentClass) {
this.componentClassName = componentClass;
}
|
public void setDynamic(boolean dynamic) {
this.dynamic = dynamic;
}
|
public void setEmbedded(boolean embedded) {
this.embedded = embedded;
}
|
public void setKey(boolean isKey) {
this.isKey = isKey;
}
|
public void setMetaAttributes(Map metas) {
this.metaAttributes = metas;
}
|
public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}
|
public void setOwner(PersistentClass owner) {
this.owner = owner;
}
|
public void setParentProperty(String parentProperty) {
this.parentProperty = parentProperty;
}
|
public void setRoleName(String roleName) {
this.roleName = roleName;
}
|
public void setTypeByReflection(String propertyClass,
String propertyName) {
}
|
public void setTypeUsingReflection(String className,
String propertyName) throws MappingException {
}
|
public String toString() {
return getClass().getName() + '(" + properties.toString() + ')";
}
|