Class SqlRepoContext

  • Direct Known Subclasses:
    SqaleRepoContext

    public class SqlRepoContext
    extends Object
    Encapsulates Querydsl Configuration, our QueryModelMappingRegistry and other parts of SQL repository config and implements methods that need these. Preferably, it should hide (hence "encapsulate") the fields and offer behavior instead.
    • Field Detail

      • querydslConfig

        protected final com.querydsl.sql.Configuration querydslConfig
    • Method Detail

      • setQuerydslSqlListener

        public void setQuerydslSqlListener​(com.querydsl.sql.SQLBaseListener listener)
        Sets Querydsl SQL listener for this repository, replacing any previously one.
      • newQuery

        public com.querydsl.sql.SQLQuery<?> newQuery()
      • newQuery

        public com.querydsl.sql.SQLQuery<?> newQuery​(Connection conn)
      • getQuerydslTemplates

        public com.querydsl.sql.SQLTemplates getQuerydslTemplates()
      • getQuerydslConfiguration

        public com.querydsl.sql.Configuration getQuerydslConfiguration()
      • newInsert

        public com.querydsl.sql.dml.SQLInsertClause newInsert​(Connection connection,
                                                              com.querydsl.sql.RelationalPath<?> entity)
      • newUpdate

        public com.querydsl.sql.dml.SQLUpdateClause newUpdate​(Connection connection,
                                                              com.querydsl.sql.RelationalPath<?> entity)
      • newDelete

        public com.querydsl.sql.dml.SQLDeleteClause newDelete​(Connection connection,
                                                              com.querydsl.sql.RelationalPath<?> entity)
      • newJdbcSession

        public JdbcSession newJdbcSession()
        Creates JdbcSession that typically represents transactional work on JDBC connection. All other lifecycle methods are to be called on the returned object. Object is AutoCloseable and can be used in try-with-resource blocks. This call be followed by JdbcSession.startTransaction() (or one of its variants). If the transaction is not started the connection will likely be in auto-commit mode. *We want to start transaction for any work in production code* but for tests it's ok not to.
      • qNameToSchemaClass

        public <T> Class<? extends T> qNameToSchemaClass​(QName qName)
      • schemaClassToQName

        public QName schemaClassToQName​(Class<?> schemaClass)
      • normalizeRelation

        @NotNull
        public @NotNull QName normalizeRelation​(QName qName)
      • createStringParser

        @NotNull
        public @NotNull PrismParserNoIO createStringParser​(String serializedResult)
      • prismContext

        public PrismContext prismContext()
        Sometimes delegation is not enough - we need Prism context for schema type construction with definitions (parameter to constructor).