Skip to content

Instantly share code, notes, and snippets.

View sebersole's full-sized avatar

Steve Ebersole sebersole

View GitHub Profile
generatedLoggingSrcMainDir = file( buildDirName + "/generated-src/logging/main" )
generatedLoggingSrcTestDir = file( buildDirName + "/generated-src/logging/test" )
sourceSets{
main {
java {
srcDir( generatedLoggingSrcMainDir )
}
compileClasspath += configurations.provided
generatedLoggingSrcMainDir = file( buildDirName + "/generated-src/logging/main" )
generatedLoggingSrcTestDir = file( buildDirName + "/generated-src/logging/test" )
sourceSets{
main {
java {
srcDir( generatedLoggingSrcMainDir )
}
compileClasspath += configurations.provided
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
project.getTasks().findByName( "compileJava" ).doLast(
new Action<Task>() {
@Override
public void execute(Task task) {
injectionTask.performAction();
}
}
);
// Current definitions
public interface Service extends Serializable {
}
public interface ServiceRegistry extends Serializable {
public <R extends Service> R getService(Class<R> serviceRole);
public <R extends Service> void registerService(Class<R> serviceRole, R service);
public <R extends Service> void registerServiceInitiator(ServiceInitiator<R> initiator);
}
@sebersole
sebersole / gist:896564
Created March 31, 2011 15:24
transaction joining tests
public class TransactionJoiningTest extends BaseEntityManagerFunctionalTestCase {
@Override
protected void addConfigOptions(Map options) {
super.addConfigOptions( options );
TestingJtaBootstrap.prepare( options );
options.put( AvailableSettings.TRANSACTION_TYPE, "JTA" );
}
@Test
[04/12/11 10:32] <sebersole> hardy: anyway, back to that Metadata discussion
[04/12/11 10:32] <sebersole> this is what we need to decide
[04/12/11 10:32] <ge0ffrey> sorry for interrupting :) tnx for the info
[04/12/11 10:32] <stliu> ge0ffrey, good, let me know if you need me do something
[04/12/11 10:32] <hardy> one sec. let me just leave the JBoss talk
[04/12/11 10:32] <sebersole> there could be *something* above Metadata
[04/12/11 10:32] <hardy> then you get my undevided attention
[04/12/11 10:32] <sebersole> hardy: ah, np
[04/12/11 10:33] <ge0ffrey> oh yea, one more thing: Can I release 2.3.5 of the maven-jdocbook-plugin?
[04/12/11 10:33] <sebersole> ge0ffrey: you maintain it now, do what you wish ;)
MetadataSources sources = new MetadataSources(...)
...
.addAnnotatedClasses( Item.class );
.buildMetadata();
MetadataSources sources = new MetadataSources(...)
...
.addAnnotatedClasses( Item.class );
.usingContext()
.setNamingStrategy( new MyNamingStrategy() )
@sebersole
sebersole / gist:976704
Created May 17, 2011 15:32
metadata (building) options
// Option 1 - Options part of MetadataBuilder which is more "natural" i think, but maybe not
// feasible if the binding code does know about MetadataBuilder (in which case see option 2).
public interface MetadataBuilder {
public static interface Options {
public boolean useNewIdentifierGenerators();
...
}
...
@sebersole
sebersole / gist:1035899
Created June 20, 2011 16:08
EntityClassName
public class EntityClassName {
private final String entityName;
private final String entityClassName;
private final InitializeOnceField<Class> entityClassReference;
public EntityClassName(String entityName, String entityClassName) {
entityClassReference = new InitializeOnceField<Class>(
new InitializeOnceField.Initializer<Class>() {
public Class initialize() {
Class entityClass = getConfiguredClass().getClassReference( entityClassName );