Skip to content

Commit

Permalink
执行create table语句时生成的model类新加decode(String str, CaseFormat format)方法
Browse files Browse the repository at this point in the history
  • Loading branch information
codefollower committed Oct 25, 2022
1 parent 86bb264 commit a0888e8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ public StorageEngine getStorageEngine() {
return storageEngine;
}

@Override
public Map<String, String> getParameters() {
return parameters;
}

@Override
public String getParameter(String name) {
return parameters.get(name);
}

@Override
public String getCreateSQL() {
StatementBuilder buff = new StatementBuilder("CREATE ");
Expand Down
9 changes: 9 additions & 0 deletions lealone-db/src/main/java/org/lealone/db/table/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.lealone.common.exceptions.DbException;
Expand Down Expand Up @@ -1101,4 +1102,12 @@ public Row getRow(ServerSession session, long key) {
public Row getRow(ServerSession session, long key, Object oldTransactionalValue) {
return null;
}

public Map<String, String> getParameters() {
return null;
}

public String getParameter(String name) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,11 @@ private static void genCode(ServerSession session, Table table, Table owner, int

// static decode方法
buff.append(" public static ").append(className).append(" decode(String str) {\r\n");
buff.append(" return new ").append(className).append("().decode0(str);\r\n");
buff.append(" return decode(str, null);\r\n");
buff.append(" }\r\n\r\n");
buff.append(" public static ").append(className)
.append(" decode(String str, CaseFormat format) {\r\n");
buff.append(" return new ").append(className).append("().decode0(str, format);\r\n");
buff.append(" }\r\n");
buff.append("}\r\n");

Expand Down

0 comments on commit a0888e8

Please sign in to comment.