Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
29d344d0
Commit
29d344d0
authored
Aug 06, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实例化关系
parent
4c4d285f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
DbPrintSql.java
...-db/src/main/java/com/yanzuoguang/db/impl/DbPrintSql.java
+24
-4
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbPrintSql.java
View file @
29d344d0
...
...
@@ -3,21 +3,41 @@ package com.yanzuoguang.db.impl;
import
com.yanzuoguang.db.ConfigDb
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.log.Log
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.BeanInitializationException
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.context.*
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
/**
* 打印SQL语句日志工具类
*
* @author 颜佐光
*/
@Component
public
class
DbPrintSql
{
public
class
DbPrintSql
implements
ApplicationContextAware
{
@Resource
private
ConfigDb
configDb
;
/**
* Set the ApplicationContext that this object runs in.
* Normally this call will be used to initialize the object.
* <p>Invoked after population of normal bean properties but before an init callback such
* as {@link InitializingBean#afterPropertiesSet()}
* or a custom init-method. Invoked after {@link ResourceLoaderAware#setResourceLoader},
* {@link ApplicationEventPublisherAware#setApplicationEventPublisher} and
* {@link MessageSourceAware}, if applicable.
*
* @param applicationContext the ApplicationContext object to be used by this object
* @throws ApplicationContextException in case of context initialization errors
* @throws BeansException if thrown by application context methods
* @see BeanInitializationException
*/
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
this
.
configDb
=
applicationContext
.
getBean
(
ConfigDb
.
class
);
}
/**
* 获取参数处理之后的SQL语句
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment