org.simpleflatmapper.jdbc.impl.JpaAliasProviderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-jdbc Show documentation
Show all versions of sfm-jdbc Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.jdbc.impl;
import org.simpleflatmapper.reflect.meta.AliasProvider;
import org.simpleflatmapper.reflect.meta.AliasProviderProducer;
import org.simpleflatmapper.util.Consumer;
public class JpaAliasProviderFactory implements AliasProviderProducer {
private boolean isActive() {
try {
Class.forName("javax.persistence.Column");
return true;
} catch (Throwable e) {
}
return false;
}
@Override
public void produce(Consumer super AliasProvider> consumer) {
if (isActive()) {
consumer.accept(new JpaAliasProvider());
}
}
}