Examples of KeyGeneratorDef


Examples of org.exolab.castor.mapping.xml.KeyGeneratorDef

        _schema.setConfiguration(_configuration);

        // Create key generators.
        Enumeration ekg = root.enumerateKeyGeneratorDef();
        while (ekg.hasMoreElements()) {
            KeyGeneratorDef definition = (KeyGeneratorDef) ekg.nextElement();
            _keyGenRegistry.createKeyGenerator(definition);
        }

        // Create tables.
        Enumeration ec = root.enumerateClassMapping();
View Full Code Here

Examples of org.exolab.castor.mapping.xml.KeyGeneratorDef

     */
    private void createKeyGenDescriptors(final MappingRoot mapping)
    throws MappingException {
        Enumeration enumeration = mapping.enumerateKeyGeneratorDef();
        while (enumeration.hasMoreElements()) {
            KeyGeneratorDef def = (KeyGeneratorDef) enumeration.nextElement();
           
            // resolve name of the key generator definition; if there's an alias
            // defined, use it; if not, fall back to the name attribute (this
            // is to ensure that for one key generator type (e.g. HIGH-LOW), it is
            // possible to define more than one instance with individual
            // configuration(s).
            String name = def.getAlias();
            if (name == null) {
                name = def.getName();
            }
           
            KeyGeneratorDescriptor desc = _keyGeneratorDescriptors.get(name);
            if (desc != null) {
                throw new MappingException(Messages.format("mapping.dupKeyGen", name));
            }
           
            Properties params = new Properties();
           
            Enumeration enumerateParam = def.enumerateParam();
            while (enumerateParam.hasMoreElements()) {
                Param par = (Param) enumerateParam.nextElement();
                params.put(par.getName(), par.getValue());
            }
           
            desc = new KeyGeneratorDescriptor(
                    name, def.getName(), params, _keyGenReg);
           
            _keyGeneratorDescriptors.put(name, desc);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.