Enhancer

Enhance JPA managed classes after compilation to support lazy initialization, improve performance and more. Static enhancement is required.
java -classpath classpath com.cmobilecom.jpa.processor.Enhancer classes_root_directory
The enhancer transforms classes (not jar). The cmobilecom-jpa-processor.jar and its dependencies must be in the classpath. The classes_root_directory includes all the classes to be enhanced. For example,
classes_root_directory/package1/Foo.class
                       package2/Bar.class
Gradle build example: enhance JPA managed classes in the main source set

Java

configurations {
	jpaEnhance
}
	
dependencies {
	jpaEnhance 'com.cmobilecom:cmobilecom-jpa-processor:1.1.1'
	
	// logging
	jpaEnhance 'ch.qos.logback:logback-classic:1.2.3'
	jpaEnhance 'ch.qos.logback:logback-core:1.2.3'
}

// enhance compiled classes
task jpaEnhance(type: JavaExec) {
	classpath = configurations.jpaEnhance
	main 'com.cmobilecom.jpa.processor.Enhancer'
	args sourceSets.main.output.classesDirs.singleFile.absolutePath
}

// UP_TO_DATE check: jpaEnhance is a part of compileJava task
compileJava.doLast {
	jpaEnhance.execute()
}

Classes are enhanced at build time. Do not add cmobilecom-jpa-processor.jar in runtime classpath.

Android

configurations {
	jpaEnhance
}

dependencies {
	jpaEnhance 'com.cmobilecom:cmobilecom-jpa-processor:1.1.1'
	
	// logging
	jpaEnhance 'ch.qos.logback:logback-classic:1.2.3'
	jpaEnhance 'ch.qos.logback:logback-core:1.2.3'
}

afterEvaluate {
	// enhance compiled classes
	task jpaEnhance(type: JavaExec) {
		classpath = configurations.jpaEnhance
		main 'com.cmobilecom.jpa.processor.Enhancer'
		args compileDebugJavaWithJavac.destinationDir
	}

	// UP_TO_DATE check: jpaEnhance is a part of compileJava task
	compileDebugJavaWithJavac.doLast {
		jpaEnhance.execute()
	}
}
Added member (field or method) names have prefix "_jpa_". Keep those names if code is obfuscated (e.g. proguard).