Skip to content

Instantly share code, notes, and snippets.

View sebersole's full-sized avatar

Steve Ebersole sebersole

View GitHub Profile
public class AnnotationFactory {
@SuppressWarnings("unchecked")
public static <T extends Annotation> T create(AnnotationDescriptor descriptor) {
//TODO round 34ms to generate the proxy, hug! is Javassist Faster?
//TODO prebuild the javax.persistence and org.hibernate.annotations classes?
Class<T> proxyClass = (Class<T>) Proxy.getProxyClass( descriptor.type().getClassLoader(), descriptor.type() );
InvocationHandler handler = new AnnotationProxy( descriptor );
try {
return getProxyInstance( proxyClass, handler );
@sebersole
sebersole / gist:46b5b7968e748648f562
Last active August 29, 2015 14:21
Dialect#buildIdentifierHelper
public class Dialect {
....
/**
* Build the IdentifierHelper indicated by this Dialect for handling
* {@link Identifier identifier) conversions. Returning {@code null} is
* allowed and indicates that Hibernate should fallback to building a
* "standard" helper. In the fallback path, any changes made to
* the IdentifierHelperBuilder during this call will still be incorporated
* into the built IdentifierHelper
public class SimpleEntity implements ManagedEntity, PersistentAttributeInterceptable, SelfDirtinessTracker, CompositeOwner {
private String name;
...
public String getName() {
return this.$$_hibernate_read_name();
}
public void setName(String name) {
karaf@root()> feature:install jpa/2.1
karaf@root()> bundle:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5
Bundle ID: 124
karaf@root()> bundle:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5
Bundle ID: 125
karaf@root()> bundle:install -s mvn:org.jboss.logging/jboss-logging/3.2.1.Final
Bundle ID: 126
Error executing command: Error installing bundles:
Unable to start bundle mvn:org.jboss.logging/jboss-logging/3.2.1.Final
karaf@root()> bundle:install -s mvn:org.apache.logging.log4j/log4j-api/2.0
testRuntime - Runtime classpath for source set 'test'.
+--- org.jboss.logging:jboss-logging:3.2.1.Final
+--- org.jboss.logging:jboss-logging-annotations:1.2.0.Final
+--- org.jboss.logging:jboss-logging-processor:1.2.0.Final
| +--- org.jboss.logging:jboss-logging-annotations:1.2.0.Final
| \--- org.jboss.jdeparser:jdeparser:1.0.0.Final
+--- project :hibernate-core
| +--- antlr:antlr:2.7.7
| +--- org.jboss.logging:jboss-logging:3.2.1.Final
| +--- org.jboss.logging:jboss-logging-annotations:1.2.0.Final
<features xmlns='http://karaf.apache.org/xmlns/features/v1.0.0'>
<feature name='hibernate-core' version='5.0.0-SNAPSHOT'>
<bundle>wrap:mvn:antlr/antlr/2.7.7</bundle>
<bundle>mvn:org.jboss.logging/jboss-logging/3.2.1.Final</bundle>
<bundle>wrap:mvn:org.jboss.logging/jboss-logging-annotations/1.2.0.Final</bundle>
<bundle>wrap:mvn:org.jboss.jdeparser/jdeparser/1.0.0.Final</bundle>
<bundle>wrap:mvn:org.jboss.logging/jboss-logging-processor/1.2.0.Final</bundle>
<bundle>mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.0.0.Final</bundle>
<bundle>mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
<features xmlns='http://karaf.apache.org/xmlns/features/v1.0.0'>
<feature name='hibernate-core' version='5.0.0-SNAPSHOT'>
<bundle>mvn:org.jboss.logging/jboss-logging/3.2.1.Final</bundle>
<bundle>wrap:mvn:org.jboss.logging/jboss-logging-annotations/1.2.0.Final</bundle>
<bundle>wrap:mvn:org.jboss.jdeparser/jdeparser/1.0.0.Final</bundle>
<bundle>wrap:mvn:org.jboss.logging/jboss-logging-processor/1.2.0.Final</bundle>
<bundle>wrap:mvn:antlr/antlr/2.7.7</bundle>
<bundle>mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.0.0.Final</bundle>
<bundle>mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
task myTask {
inputs.files project.sourceSets.main.resources +
project.configurations.compile.dependencies.findAll{ it instanceof ProjectDependency }.dependencyProject.sourceSets.main.resources
}
<features xmlns='http://karaf.apache.org/xmlns/features/v1.0.0'>
<feature name='hibernate-core' version='5.0.0-SNAPSHOT'>
<bundle>mvn:antlr/antlr/2.7.7</bundle>
<bundle>mvn:org.jboss.logging/jboss-logging/3.2.1.Final</bundle>
<bundle>mvn:org.jboss.logging/jboss-logging-annotations/1.2.0.Final</bundle>
<bundle>mvn:org.jboss.logging/jboss-logging-annotations/1.2.0.Final</bundle>
<bundle>mvn:org.jboss.jdeparser/jdeparser/1.0.0.Final</bundle>
<bundle>mvn:org.jboss.logging/jboss-logging-processor/1.2.0.Final</bundle>
<bundle>mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.0.0.Final</bundle>
<bundle>mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
@sebersole
sebersole / gist:1fcdca7ed1a4a6f4114d
Created April 21, 2015 13:43
Gradle build error using Java 8
[sebersole@t540 gradle]$ gradlew idea --stacktrace
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> Could not call GroovyCompile.compile() on task ':compileGroovy'