Created
June 26, 2012 15:53
-
-
Save dfilppi/2996627 to your computer and use it in GitHub Desktop.
The Persistent annotation definition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.TYPE) | |
@Inherited | |
public @interface Persistent { | |
Class<? extends BulkDataPersister>[] persistTo() default {NullBulkDataPersister.class}; | |
Class<? extends ManagedDataSource<?>> loadFrom() default NullManagedDataSource.class; | |
} | |
class NullBulkDataPersister implements BulkDataPersister{ | |
@Override | |
public void executeBulk(List<BulkItem> arg0) throws DataSourceException { | |
} | |
} | |
class NullManagedDataSource implements ManagedDataSource<Object>{ | |
@Override | |
public void init(Properties arg0) throws DataSourceException { | |
} | |
@Override | |
public DataIterator<Object> initialLoad() throws DataSourceException { | |
return null; | |
} | |
@Override | |
public void shutdown() throws DataSourceException { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment