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

jpa4azure.type.Jpa4AzureAnnotations Maven / Gradle / Ivy

Go to download

jpa4azure, implements a subset of the JPA specification using Azure Storage for pesisting beans. see http://jpa4azure.codeplex.com for more information.

The newest version!
package jpa4azure.type;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.Embedded;
import javax.persistence.Transient;


class Jpa4AzureAnnotations {

	

	public FieldContext[] getFields(Collection fields, Object o) {
		ArrayList values = new ArrayList();
		
		for (Field field : fields) {
			if (Key.class.isAssignableFrom(field.getType()))
				continue;
			else if (field.getType().isAssignableFrom(Collection.class))
				continue;
			else if (field.isAnnotationPresent(Transient.class))
				continue;
			else if (field.getType().isEnum())
				values.add(new EnumContext(o,field));
			else if (field.isAnnotationPresent(Embedded.class))
				values.add(new EmbeddedContext(o, field));
			else if (PrimitiveWrapper.isPrimitive(field.getType()))
				values.add(new FieldContext(o, field));
			else
				values.add(new CompoundFieldContext(o,field));
		}
		return values.toArray(new FieldContext[0]);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy