Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
*
* Copyright (C) 2012-2013 DuyHai DOAN
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package info.archinnov.achilles.proxy;
import static info.archinnov.achilles.cql.CQLTypeMapper.*;
import info.archinnov.achilles.entity.metadata.PropertyMeta;
import info.archinnov.achilles.exception.AchillesException;
import info.archinnov.achilles.validation.Validator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.datastax.driver.core.ColumnDefinitions.Definition;
import com.datastax.driver.core.Row;
public class CQLRowMethodInvoker {
public Object invokeOnRowForFields(Row row, PropertyMeta pm) {
String propertyName = pm.getPropertyName().toLowerCase();
Object value = null;
if (row != null && !row.isNull(propertyName)) {
switch (pm.type()) {
case LIST:
case LAZY_LIST:
value = invokeOnRowForList(row, pm, propertyName, pm.getValueClass());
break;
case SET:
case LAZY_SET:
value = invokeOnRowForSet(row, pm, propertyName, pm.getValueClass());
break;
case MAP:
case LAZY_MAP:
Class keyClass = pm.getKeyClass();
Class valueClass = pm.getValueClass();
value = invokeOnRowForMap(row, pm, propertyName, keyClass, valueClass);
break;
case ID:
case SIMPLE:
case LAZY_SIMPLE:
value = invokeOnRowForProperty(row, pm, propertyName, pm.getValueClass());
break;
default:
break;
}
}
return value;
}
public Object extractCompoundPrimaryKeyFromRow(Row row, PropertyMeta pm, boolean isManagedEntity) {
List componentNames = pm.getCQLComponentNames();
List> componentClasses = pm.getComponentClasses();
List