protected void resolveSqlCommands(Dao dao, OrmMetadata md) { //TODO : cleanupAccessTokensCommand = md.tryGetSqlCommand(CLEANUP_ACCESS_TOKENS_SQL_KEY); cleanupRefreshTokensCommand = md.tryGetSqlCommand(CLEANUP_REFRESH_TOKENS_SQL_KEY); } }
protected void resolveSqlCommands(Dao dao, OrmMetadata md) { loadAuthorizationCodeCommand = md.tryGetSqlCommand(LOAD_AUTHORIZATION_CODE_SQL_KEY); deleteAuthorizationCodeCommand = md.tryGetSqlCommand(DELETE_AUTHORIZATION_CODE_SQL_KEY); cleanupAuthorizationCodesCommand = md.tryGetSqlCommand(CLEANUP_AUTHORIZATION_CODES_SQL_KEY); }
protected void resolveSqlCommands(Dao dao, OrmMetadata md) { loadSessionByTokenCommand = md.tryGetSqlCommand(LOAD_SESSION_BY_TOKEN_SQL_KEY); loadSessionByIdCommand = md.tryGetSqlCommand(LOAD_SESSION_BY_ID_SQL_KEY); loadLoginsInSessionCommand = md.tryGetSqlCommand(LOAD_LOGINS_IN_SESSION_SQL_KEY); cleanupLoginsCommand = md.tryGetSqlCommand(CLEANUP_SSO_LOGINS_SQL_KEY); cleanupSessionsCommand = md.tryGetSqlCommand(CLEANUP_SSO_SESSIONS_SQL_KEY); } }
protected void resolveSqlCommands(Dao dao, OrmMetadata md) { //TODO : cleanupAccessTokensCommand = md.tryGetSqlCommand(CLEANUP_ACCESS_TOKENS_SQL_KEY); cleanupRefreshTokensCommand = md.tryGetSqlCommand(CLEANUP_REFRESH_TOKENS_SQL_KEY); } }
protected void resolveSqlCommands(Dao dao, OrmMetadata md) { loadSessionByTokenCommand = md.tryGetSqlCommand(LOAD_SESSION_BY_TOKEN_SQL_KEY); loadSessionByIdCommand = md.tryGetSqlCommand(LOAD_SESSION_BY_ID_SQL_KEY); loadLoginsInSessionCommand = md.tryGetSqlCommand(LOAD_LOGINS_IN_SESSION_SQL_KEY); cleanupLoginsCommand = md.tryGetSqlCommand(CLEANUP_SSO_LOGINS_SQL_KEY); cleanupSessionsCommand = md.tryGetSqlCommand(CLEANUP_SSO_SESSIONS_SQL_KEY); } }
protected void resolveSqlCommands(Dao dao, OrmMetadata md) { loadClientCommand = md.tryGetSqlCommand(LOAD_CLIENT_SQL_KEY); } }
protected void resolveSqlCommands(Dao dao, OrmMetadata md) { loadClientCommand = md.tryGetSqlCommand(LOAD_CLIENT_SQL_KEY); } }
protected void resolveSqlCommands(Dao dao, OrmMetadata md) { loadAuthorizationCodeCommand = md.tryGetSqlCommand(LOAD_AUTHORIZATION_CODE_SQL_KEY); deleteAuthorizationCodeCommand = md.tryGetSqlCommand(DELETE_AUTHORIZATION_CODE_SQL_KEY); cleanupAuthorizationCodesCommand = md.tryGetSqlCommand(CLEANUP_AUTHORIZATION_CODES_SQL_KEY); }
protected SqlCommand ensureGetSqlCommand(String key) { Args.notEmpty(key, "sql key"); SqlCommand command = metadata().tryGetSqlCommand(key); if(null == command){ throw new SqlNotFoundException("Sql command '" + key + "' not found"); } return command; }
protected void tryCreateDeleteCommand(MetadataContext context,EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.DELETE_COMMAND_NAME); if(null == cmd){ tryAddSqlCommand(context,em, SqlCommand.DELETE_COMMAND_NAME, sqlFactory.createDeleteCommand(context,em)); } }
protected void tryCreateFindAllCommand(MetadataContext context, EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.FIND_ALL_COMMAND_NAME); if(null == cmd){ tryAddSqlCommand(context,em, SqlCommand.FIND_ALL_COMMAND_NAME, sqlFactory.createFindAllCommand(context,em)); } }
protected void tryCreateFindCommand(MetadataContext context,EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.FIND_COMMAND_NAME); if(null == cmd){ tryAddSqlCommand(context,em, SqlCommand.FIND_COMMAND_NAME, sqlFactory.createFindCommand(context,em)); } }
protected void tryCreateInsertCommand(MetadataContext context,EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.INSERT_COMMAND_NAME); if(null == cmd){ tryAddSqlCommand(context, em, SqlCommand.INSERT_COMMAND_NAME, sqlFactory.createInsertCommand(context,em)); } }
protected void tryCreateUpdateCommand(MetadataContext context,EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.UPDATE_COMMAND_NAME); if(null == cmd){ tryAddSqlCommand(context, em, SqlCommand.UPDATE_COMMAND_NAME, sqlFactory.createUpdateCommand(context,em)); } }
private void tryCreateDeleteAllCommand(MetadataContext context, EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.DELETE_ALL_COMMAND_NAME); if(null == cmd){ tryAddSqlCommand(context,em, SqlCommand.DELETE_ALL_COMMAND_NAME, sqlFactory.createDeleteAllCommand(context,em)); } }
protected void tryCreateExistsCommand(MetadataContext context, EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.EXISTS_COMMAND); if(null == cmd){ tryAddSqlCommand(context,em, SqlCommand.EXISTS_COMMAND, sqlFactory.createExistsCommand(context,em)); } }
protected void tryCreateCountCommand(MetadataContext context, EntityMapping em) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.COUNT_COMMAND); if(null == cmd){ tryAddSqlCommand(context,em, SqlCommand.COUNT_COMMAND, sqlFactory.createCountCommand(context,em)); } }
@Override public Query<Record> createNamedQuery(String queryName) { Args.notEmpty(queryName,"query name"); SqlCommand command = metadata().tryGetSqlCommand(queryName); if(null == command){ throw new SqlNotFoundException("Query '" + queryName + "' not found"); } return (Query)queryFactory().createQuery(this, Record.class, command); }
protected void tryCreateFindListCommand(MetadataContext context,EntityMapping em) { if(!em.isCompositeKey()) { SqlCommand cmd = context.getMetadata().tryGetSqlCommand(em.getEntityName(), SqlCommand.FIND_LIST_COMMAND_NAME); if(null == cmd){ tryAddSqlCommand(context,em, SqlCommand.FIND_LIST_COMMAND_NAME, sqlFactory.createFindListCommand(context,em)); } } }
@Override public <T> Query<T> createNamedQuery(String queryName, Class<T> resultClass) { Args.notEmpty(queryName,"query name"); Args.notNull(resultClass,"result class"); if(isEntityClass(resultClass)){ return this.createNamedQuery(resultClass,queryName); } SqlCommand command = metadata().tryGetSqlCommand(queryName); if(null == command){ throw new SqlNotFoundException("Query '" + queryName + "' not found"); } return queryFactory().createQuery(this, resultClass, command); }