org.datanucleus.metadata.ValueMetaData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datanucleus-core Show documentation
Show all versions of datanucleus-core Show documentation
DataNucleus Core provides the primary components of a heterogenous Java persistence solution.
It supports persistence API's being layered on top of the core functionality.
/**********************************************************************
Copyright (c) 2004 Erik Bengtson and others. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributors:
2004 Andy Jefferson - added toString(), MetaData docs, javadocs.
2004 Andy Jefferson - added unique, indexed
...
**********************************************************************/
package org.datanucleus.metadata;
import org.datanucleus.ClassLoaderResolver;
import org.datanucleus.exceptions.ClassNotResolvedException;
import org.datanucleus.exceptions.NucleusFatalUserException;
/**
* This element specifies the mapping for the value component of maps.
* The serialised attribute specifies that the key values are to be serialised into the named column.
*/
public class ValueMetaData extends AbstractElementMetaData
{
private static final long serialVersionUID = -3179830024157613599L;
/**
* Constructor to create a copy of the passed metadata using the provided parent.
* @param vmd The metadata to copy
*/
public ValueMetaData(ValueMetaData vmd)
{
super(vmd);
}
/**
* Default constructor. Set the fields using setters, before populate().
*/
public ValueMetaData()
{
}
/**
* Populate the MetaData.
* @param clr Class loader to use
* @param primary the primary ClassLoader to use (or null)
*/
public void populate(ClassLoaderResolver clr, ClassLoader primary)
{
AbstractMemberMetaData mmd = (AbstractMemberMetaData)parent;
if (mmd.getMap() == null)
{
// TODO Change this to InvalidMetaDataException
throw new NucleusFatalUserException("The field "+mmd.getFullFieldName()+" is defined with , however no