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
bb98b00e
Commit
bb98b00e
authored
Mar 11, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实体位置
parent
08851fb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
QueueServerDaoImpl.java
.../java/com/yanzuoguang/mq/dao/impl/QueueServerDaoImpl.java
+14
-2
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/dao/impl/QueueServerDaoImpl.java
View file @
bb98b00e
...
@@ -5,6 +5,7 @@ import com.yanzuoguang.db.DbExecute;
...
@@ -5,6 +5,7 @@ import com.yanzuoguang.db.DbExecute;
import
com.yanzuoguang.mq.dao.QueueServerDao
;
import
com.yanzuoguang.mq.dao.QueueServerDao
;
import
com.yanzuoguang.mq.vo.QueueServerVo
;
import
com.yanzuoguang.mq.vo.QueueServerVo
;
import
com.yanzuoguang.util.vo.MapRow
;
import
com.yanzuoguang.util.vo.MapRow
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.List
;
...
@@ -15,7 +16,7 @@ import java.util.List;
...
@@ -15,7 +16,7 @@ import java.util.List;
* @author 颜佐光
* @author 颜佐光
*/
*/
@Component
@Component
public
class
QueueServerDaoImpl
extends
BaseDaoImpl
implements
QueueServerDao
{
public
class
QueueServerDaoImpl
extends
BaseDaoImpl
implements
QueueServerDao
,
InitializingBean
{
private
static
final
String
QUERY_TABLE_SQL
=
"SHOW TABLES LIKE 'queue_server'"
;
private
static
final
String
QUERY_TABLE_SQL
=
"SHOW TABLES LIKE 'queue_server'"
;
private
static
final
String
CREATE_TABLE_SQL
=
"CREATE TABLE `queue_server` ("
+
private
static
final
String
CREATE_TABLE_SQL
=
"CREATE TABLE `queue_server` ("
+
" `serverId` varchar(32) NOT NULL COMMENT '服务Id',"
+
" `serverId` varchar(32) NOT NULL COMMENT '服务Id',"
+
...
@@ -32,8 +33,19 @@ public class QueueServerDaoImpl extends BaseDaoImpl implements QueueServerDao {
...
@@ -32,8 +33,19 @@ public class QueueServerDaoImpl extends BaseDaoImpl implements QueueServerDao {
register
(
QueueServerVo
.
class
);
register
(
QueueServerVo
.
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
@Override
protected
void
initExecute
(
DbExecute
db
)
{
public
void
afterPropertiesSet
()
throws
Exception
{
DbExecute
db
=
this
.
getDb
();
List
<
MapRow
>
tables
=
db
.
query
(
QueueServerDaoImpl
.
class
,
"QUERY_TABLE_SQL"
,
QUERY_TABLE_SQL
);
List
<
MapRow
>
tables
=
db
.
query
(
QueueServerDaoImpl
.
class
,
"QUERY_TABLE_SQL"
,
QUERY_TABLE_SQL
);
if
(
tables
.
isEmpty
())
{
if
(
tables
.
isEmpty
())
{
db
.
update
(
QueueServerDaoImpl
.
class
,
"CREATE_TABLE_SQL"
,
CREATE_TABLE_SQL
);
db
.
update
(
QueueServerDaoImpl
.
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