private static Attributes fromTransientToAttributes(Object obj) {
        EntityMetaData metaData = EntityMetaData.get(ClassHelper.actualClass(obj));
        Attributes toSaves = new BasicAttributes();
        for (EntityPropertyMetaData propMetaData : metaData) {
        	Object propValue = propMetaData.getter().get(obj);
            if (propValue == null) {
                continue;
            }
            
            // ignore empty list when create
            if (propMetaData.isMultiple() && ((List) propValue).isEmpty()) {
                continue;
            }
            
            Evaluator<String> evaluator = null;
            if (propMetaData.isReference()) {
                // reference property use dn as attribute value
                final EntityMetaData metaDataOfReferenceProp = EntityMetaData.get(propMetaData.getValueClass());
                evaluator = new Evaluator<String>() {
                    public String eval(Object obj) {
                        Object idValue = metaDataOfReferenceProp.getIdProperty().getter().get(obj);
                        if (null == idValue) {
                            return null;
                        }
                        return DnHelper.build((String)idValue, metaDataOfReferenceProp.getManagedClass());
                    }
                };
            } else {
            	evaluator = createPropEvaluator(propMetaData);
            }
            
            if (!propMetaData.isMultiple()) {
                AttrUtils.putIfNotNull(toSaves, AttrUtils.create(propMetaData.getLdapPropName(), propValue, evaluator));
            } else {
                AttrUtils.putIfNotNull(toSaves, AttrUtils.create(propMetaData.getLdapPropName(), (List)propValue, evaluator));
            }
        }
        
        toSaves.put(AttrUtils.create("objectclass", metaData.objectClasses()));
        return toSaves;
    }