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
08851fb1
Commit
08851fb1
authored
Mar 11, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实体位置
parent
8216dfb5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
QueueServerTokenDaoImpl.java
.../com/yanzuoguang/mq/dao/impl/QueueServerTokenDaoImpl.java
+15
-5
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/dao/impl/QueueServerTokenDaoImpl.java
View file @
08851fb1
package
com
.
yanzuoguang
.
mq
.
dao
.
impl
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.db.DbExecute
;
import
com.yanzuoguang.mq.dao.QueueServerTokenDao
;
import
com.yanzuoguang.mq.vo.QueueServerTokenVo
;
import
com.yanzuoguang.util.vo.MapRow
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
...
...
@@ -15,7 +15,7 @@ import java.util.List;
* @author 颜佐光
*/
@Component
public
class
QueueServerTokenDaoImpl
extends
BaseDaoImpl
implements
QueueServerTokenDao
{
public
class
QueueServerTokenDaoImpl
extends
BaseDaoImpl
implements
QueueServerTokenDao
,
InitializingBean
{
private
static
final
String
QUERY_TABLE_SQL
=
"SHOW TABLES LIKE 'queue_servertoken'"
;
private
static
final
String
CREATE_TABLE_SQL
=
"CREATE TABLE `queue_servertoken` ("
+
" `serverTokenId` varchar(32) NOT NULL COMMENT '编号',"
+
...
...
@@ -36,11 +36,21 @@ public class QueueServerTokenDaoImpl extends BaseDaoImpl implements QueueServerT
register
(
QueueServerTokenVo
.
class
);
}
/**
* Invoked by a BeanFactory after it has set all bean properties supplied
* (and satisfied BeanFactoryAware and ApplicationContextAware).
* <p>This method allows the bean instance to perform initialization only
* possible when all bean properties have been set and to throw an
* exception in the event of misconfiguration.
*
* @throws Exception in the event of misconfiguration (such
* as failure to set an essential property) or if initialization fails.
*/
@Override
p
rotected
void
initExecute
(
DbExecute
db
)
{
List
<
MapRow
>
tables
=
db
.
query
(
QueueServerTokenDaoImpl
.
class
,
"QUERY_TABLE_SQL"
,
QUERY_TABLE_SQL
);
p
ublic
void
afterPropertiesSet
()
throws
Exception
{
List
<
MapRow
>
tables
=
this
.
getDb
()
.
query
(
QueueServerTokenDaoImpl
.
class
,
"QUERY_TABLE_SQL"
,
QUERY_TABLE_SQL
);
if
(
tables
.
isEmpty
())
{
db
.
update
(
QueueServerTokenDaoImpl
.
class
,
"CREATE_TABLE_SQL"
,
CREATE_TABLE_SQL
);
this
.
getDb
()
.
update
(
QueueServerTokenDaoImpl
.
class
,
"CREATE_TABLE_SQL"
,
CREATE_TABLE_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