Package org.exolab.castor.mapping

Examples of org.exolab.castor.mapping.ClassDescriptor


        try {
            // must create record in the parent table first. all other dependents
            // are created afterwards. quick and very dirty hack to try to make
            // multiple class on the same table work.
            if (extended != null) {
                ClassDescriptor extDesc = extended.getDescriptor();
                if (!new ClassDescriptorJDONature(extDesc).getTableName().equals(_mapTo)) {
                    internalIdentity = extended.create(database, conn, entity, internalIdentity);
                }
            }
           
View Full Code Here


        try {
            // must create record in the parent table first. all other dependents
            // are created afterwards. quick and very dirty hack to try to make
            // multiple class on the same table work.
            if (extended != null) {
                ClassDescriptor extDesc = extended.getDescriptor();
                if (!new ClassDescriptorJDONature(extDesc).getTableName().equals(_mapTo)) {
                    internalIdentity = extended.create(database, conn, entity, internalIdentity);
                }
            }
           
View Full Code Here

        try {
            // must create record in the parent table first. all other dependents
            // are created afterwards. quick and very dirty hack to try to make
            // multiple class on the same table work.
            if (extended != null) {
                ClassDescriptor extDesc = extended.getDescriptor();
                if (!new ClassDescriptorJDONature(extDesc).getTableName().equals(_mapTo)) {
                    internalIdentity = extended.create(database, conn, entity, internalIdentity);
                }
            }
           
View Full Code Here

     * @param type
     *            to lookup the descriptor for.
     * @return an instance of ClassDescriptor if found, null if not.
     */
    public ClassDescriptor resolve(final Class type) {
        ClassDescriptor classDesc = null;
        ClassLoader classLoader = new ClassLoaderNature(this).getClassLoader();
        Class descriptorClass = null;
        StringBuffer descriptorClassName = new StringBuffer(type.getName());
        descriptorClassName.append(JDOConstants.JDO_DESCRIPTOR_SUFFIX);

View Full Code Here

    public ClassDescriptor resolve(final Class type) throws ResolverException {
        if (type == null) {
            return null;
        }

        ClassDescriptor classDesc = null;

        // 1) consult with cache
        classDesc = resolveByCache(type);
        if (classDesc != null) {
            return classDesc;
View Full Code Here

     * @param type
     *            type to look up.
     * @return a {@link ClassDescriptor} if found, null if not.
     */
    private ClassDescriptor resolveByCache(final Class type) {
        ClassDescriptor classDesc = null;
        classDesc = (ClassDescriptor) _classDescriptorCache.get(type);
        return classDesc;
    }
View Full Code Here

        }
        clsDesc.setJavaClass(javaClass);
       
        // If this class extends another class, we need to obtain the extended
        // class and make sure this class indeed extends it.
        ClassDescriptor extDesc = getExtended(classMapping, javaClass);
        if (extDesc != null) {
            if (!(extDesc.hasNature(ClassDescriptorJDONature.class.getName()))) {
                throw new IllegalArgumentException(
                        "Extended class does not have a JDO descriptor");
            }
           
            new ClassDescriptorJDONature(extDesc).addExtended(clsDesc);
View Full Code Here

     */
    protected void resolveRelations(final ClassDescriptor clsDesc) {
        FieldDescriptor[] fields = clsDesc.getFields();
        for (int i = 0; i < fields.length; ++i) {
            FieldDescriptor field = fields[i];
            ClassDescriptor desc = getDescriptor(field.getFieldType().getName());
            // Resolve ClassDescriptor from the file system as well.
            if (desc == null && !field.getFieldType().isPrimitive()) {
                ClassResolutionByFile resolutionCommand = new ClassResolutionByFile();
                resolutionCommand.addNature(ClassLoaderNature.class.getName());
                ClassLoaderNature clNature = new ClassLoaderNature(
View Full Code Here

        // Must store record in parent table first.
        // All other dependents are stored independently.
        SQLEngine extended = _engine.getExtends();
        if (extended != null) {
            // | quick and very dirty hack to try to make multiple class on the same table work
            ClassDescriptor extDesc = extended.getDescriptor();
            if (!new ClassDescriptorJDONature(extDesc).getTableName().equals(_mapTo)) {
                extended.store(conn, identity, newentity, oldentity);
            }
        }
View Full Code Here

                String className = (String) classes.nextElement();
                String classDescriptorName = cdrList.getProperty(className);
                Class classDescriptor = ResolveHelpers.loadClass(loader,
                        classDescriptorName);
                if (classDescriptor != null) {
                    ClassDescriptor descriptorInstance = (ClassDescriptor) classDescriptor
                            .newInstance();
                    descriptors.put(className, descriptorInstance);
                }
            }
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.exolab.castor.mapping.ClassDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.