Skip to content

Commit

Permalink
fix too many instance variables #3049
Browse files Browse the repository at this point in the history
  • Loading branch information
yurake committed Feb 14, 2023
1 parent 1285b43 commit e76b6a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ public class MysqlService implements Database {
@ConfigProperty(name = "mysql.delete.msg")
String deletesql;

@ConfigProperty(name = "mysql.id")
String sqlkey;

@ConfigProperty(name = "mysql.body")
String sqlbody;

private final Logger logger = Logger.getLogger(this.getClass().getSimpleName());

public boolean connectionStatus() {
Expand All @@ -64,8 +58,8 @@ public boolean connectionStatus() {
@Override
public MsgBean insertMsg() throws SQLException, NoSuchAlgorithmException {
MsgBean msgbean = new MsgBean(CreateId.createid(), message, "Insert");
String sql = insertsql.replace(sqlkey, MsgUtils.intToString(msgbean.getId()))
.replace(sqlbody, msgbean.getMessage());
String sql = insertsql.replace("msgid", MsgUtils.intToString(msgbean.getId()))
.replace("msgbody", msgbean.getMessage());

try (Connection con = ds.getConnection();
Statement stmt = con.createStatement()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ quarkus.hibernate-orm.dialect=org.hibernate.dialect.MySQLDialect
mysql.insert.msg=INSERT INTO msg (id, msg) VALUES (msgid, 'msgbody')
mysql.select.msg=SELECT * FROM msg
mysql.delete.msg=DELETE FROM msg
mysql.id=msgid
mysql.body=msgbody
mysql.msg.quarkus=throuth quarkus

# cache
quarkus.cache.caffeine."mysql_select_msg".expire-after-write=1S

0 comments on commit e76b6a7

Please sign in to comment.