All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.cfg.binder.MetaAttributesBinder Maven / Gradle / Ivy

There is a newer version: 5.6.15.Final
Show newest version
package org.hibernate.cfg.binder;

import java.util.Iterator;
import java.util.Map;

import org.hibernate.cfg.reveng.RevEngUtils;
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.MetaAttribute;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.Selectable;
import org.hibernate.mapping.Table;

public class MetaAttributesBinder {

    public static Property bindMetaAttributes(
    		Property property, 
    		ReverseEngineeringStrategy revengStrategy,
    		Table table,
    		String defaultCatalog,
    		String defaultSchema) {
    	Iterator columnIterator = property.getValue().getColumnIterator();
		while(columnIterator.hasNext()) {
			Column col = (Column) columnIterator.next();
			Map map = RevEngUtils.getColumnToMetaAttributesInRevengStrategy(
					revengStrategy, 
					table, 
					defaultCatalog, 
					defaultSchema, 
					col.getName());
			if(map!=null) { 
				property.setMetaAttributes(map);
			}
		}

		return property;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy