Package org.exolab.castor.persist.spi

Examples of org.exolab.castor.persist.spi.KeyGenerator


        buildStatement();
    }
   
    private KeyGenerator getKeyGenerator(final SQLEngine engine,
            final PersistenceFactory factory) throws MappingException {
        KeyGenerator keyGen = null;
        if (engine.getDescriptor().getExtends() == null) {
            KeyGeneratorDescriptor keyGenDesc =
                new ClassDescriptorJDONature(engine.getDescriptor()).getKeyGeneratorDescriptor();
            if (keyGenDesc != null) {
                FieldDescriptor fldDesc = engine.getDescriptor().getIdentity();
                int[] tempType = new FieldDescriptorJDONature(fldDesc).getSQLType();
                keyGen = keyGenDesc.getKeyGeneratorRegistry().getKeyGenerator(
                        factory, keyGenDesc, (tempType == null) ? 0 : tempType[0]);

                // Does the key generator support the sql type specified in the mapping?
                keyGen.supportsSqlType(tempType[0]);
            }
        }
        return keyGen;
    }
View Full Code Here


            final KeyGeneratorDescriptor descriptor, final int sqlType) throws MappingException {
        KeyGeneratorFactory keyGeneratorFactory;
        String keyGeneratorName = descriptor.getName() + " " + sqlType;
       
        // check whether there's already a valid KeyGenerator instance registered.
        KeyGenerator keyGenerator = (KeyGenerator) _keyGenerators.get(keyGeneratorName);

        if (keyGenerator == null) {
            keyGeneratorFactory = KeyGeneratorFactoryRegistry.getKeyGeneratorFactory(
                    descriptor.getKeyGeneratorFactoryName());
View Full Code Here

                                         int sqlType )
            throws MappingException
    {
        String keyGenName;
        KeyGeneratorFactory keyGenFactory;
        KeyGenerator keyGen;

        keyGenName = desc.getName() + " " + sqlType;
        keyGen = (KeyGenerator) _keyGens.get( keyGenName );
        if ( keyGen == null ) {
            keyGenFactory = KeyGeneratorFactoryRegistry.getKeyGeneratorFactory(
View Full Code Here

                                         LogInterceptor logInterceptor )
            throws MappingException
    {
        String keyGenName;
        KeyGeneratorFactory keyGenFactory;
        KeyGenerator keyGen;

        keyGenName = desc.getName() + " " + sqlType;
        keyGen = (KeyGenerator) _keyGens.get( keyGenName );
        if ( keyGen == null ) {
            keyGenFactory = KeyGeneratorFactoryRegistry.getKeyGeneratorFactory(
View Full Code Here

TOP

Related Classes of org.exolab.castor.persist.spi.KeyGenerator

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.