Examples of SqlStatementCustomizer


Examples of org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer

    public static class MapAsBeanFactory implements SqlStatementCustomizerFactory {

        @Override
        public SqlStatementCustomizer createForMethod(final Annotation annotation, Class sqlObjectType, Method method) {
            return new SqlStatementCustomizer() {
                @Override
                public void apply(SQLStatement s) throws SQLException {
                    Query q = (Query) s;
                    q.registerMapper(new TranslationAwareBeanMapperFactory());
                }
View Full Code Here

Examples of org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer

       public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method) {

          Class<?> beanType = Resolver.findBeanType(sqlObjectType, method);
          try {
             final StatementRewriter rw = new AutoInsertWriter(beanType);
             return new SqlStatementCustomizer() {
                public void apply(SQLStatement q) {
                   q.setStatementRewriter(rw);
                }
             };
          } catch(Exception e) {
View Full Code Here

Examples of org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer

       public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method) {

          Class<?> beanType = Resolver.findBeanType(sqlObjectType, method);
          try {
             final StatementRewriter rw = new AutoUpdateByPKWriter(beanType);
             return new SqlStatementCustomizer() {
                public void apply(SQLStatement q) {
                   q.setStatementRewriter(rw);
                }
             };
          } catch(Exception e) {
View Full Code Here

Examples of org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer

       public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method) {

          Class<?> beanType = Resolver.findBeanType(sqlObjectType, method);
          try {
             final StatementRewriter rw = new AutoSelectByPKWriter(beanType);
             return new SqlStatementCustomizer() {
                public void apply(SQLStatement q) {
                   q.setStatementRewriter(rw);
                }
             };
          } catch(Exception e) {
View Full Code Here

Examples of org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer

       public SqlStatementCustomizer createForMethod(Annotation annotation, Class sqlObjectType, Method method) {

          Class<?> beanType = Resolver.findBeanType(sqlObjectType, method);
          try {
             final StatementRewriter rw = new AutoDeleteByPKWriter(beanType);
             return new SqlStatementCustomizer() {
                public void apply(SQLStatement q) {
                   q.setStatementRewriter(rw);
                }
             };
          } catch(Exception e) {
View Full Code Here

Examples of org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer

    public static class MapAsBeanFactory implements SqlStatementCustomizerFactory {

        @Override
        public SqlStatementCustomizer createForMethod(final Annotation annotation, Class sqlObjectType, Method method) {
            return new SqlStatementCustomizer() {
                @Override
                public void apply(SQLStatement s) throws SQLException {
                    Query q = (Query) s;
                    Class<? extends TranslatingStrategyAware> translater = ((MapResultForSnakeCaseAsBean) annotation).translaterClass();
                    q.registerMapper(new TranslationAwareBeanMapperFactory(translater));
View Full Code Here

Examples of org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer

          AutoUpdateByPK anno = (AutoUpdateByPK) annotation;
          Class<?> beanType = findBeanType(method);
          try {
             final StatementRewriter rw = new AutoUpdateByPKWriter(anno.translaterClass(), beanType);
             return new SqlStatementCustomizer() {
                public void apply(SQLStatement q) {
                   q.setStatementRewriter(rw);
                }
             };
          } catch(Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.