Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
haiyangl committed Oct 23, 2024
1 parent fd8f05d commit a4f848f
Show file tree
Hide file tree
Showing 7 changed files with 1,196 additions and 1,667 deletions.
47 changes: 24 additions & 23 deletions samples/codes/entity/User.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
package codes.entity;

import jakarta.persistence.Column;
import javax.persistence.Id;

import com.landawn.abacus.annotation.JsonXmlConfig;
import com.landawn.abacus.annotation.NonUpdatable;
import com.landawn.abacus.annotation.ReadOnly;
import com.landawn.abacus.annotation.Table;
import com.landawn.abacus.annotation.Type;
import com.landawn.abacus.annotation.Type.EnumBy;
import com.landawn.abacus.util.NamingPolicy;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@JsonXmlConfig(namingPolicy = NamingPolicy.UPPER_CASE_WITH_UNDERSCORE, ignoredFields = { "id", "create_time" }, dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'", timeZone = "PDT", numberFormat = "#.###", enumerated = EnumBy.ORDINAL)
import jakarta.persistence.Column;
import javax.persistence.Id;

import com.landawn.abacus.annotation.JsonXmlConfig;
import com.landawn.abacus.annotation.NonUpdatable;
import com.landawn.abacus.annotation.ReadOnly;
import com.landawn.abacus.annotation.Table;
import com.landawn.abacus.annotation.Type;
import com.landawn.abacus.annotation.Type.EnumBy;
import com.landawn.abacus.util.NamingPolicy;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@JsonXmlConfig(namingPolicy = NamingPolicy.UPPER_CASE_WITH_UNDERSCORE, ignoredFields = { "id",
"create_time" }, dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'", timeZone = "PDT", numberFormat = "#.###", enumerated = EnumBy.ORDINAL)
@Table("user1")
public class User {

Expand Down
55 changes: 28 additions & 27 deletions samples/codes/entity/UserQueryAllResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@
import java.util.List;
import java.util.Set;

import jakarta.persistence.Column;
import javax.persistence.Id;

import com.landawn.abacus.annotation.JsonXmlConfig;
import com.landawn.abacus.annotation.NonUpdatable;
import com.landawn.abacus.annotation.ReadOnly;
import com.landawn.abacus.annotation.Table;
import com.landawn.abacus.annotation.Type;
import com.landawn.abacus.annotation.Type.EnumBy;
import com.landawn.abacus.util.NamingPolicy;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@JsonXmlConfig(namingPolicy = NamingPolicy.UPPER_CASE_WITH_UNDERSCORE, ignoredFields = { "id", "create_time" }, dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'", timeZone = "PDT", numberFormat = "#.###", enumerated = EnumBy.ORDINAL)
import jakarta.persistence.Column;
import javax.persistence.Id;

import com.landawn.abacus.annotation.JsonXmlConfig;
import com.landawn.abacus.annotation.NonUpdatable;
import com.landawn.abacus.annotation.ReadOnly;
import com.landawn.abacus.annotation.Table;
import com.landawn.abacus.annotation.Type;
import com.landawn.abacus.annotation.Type.EnumBy;
import com.landawn.abacus.util.NamingPolicy;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@JsonXmlConfig(namingPolicy = NamingPolicy.UPPER_CASE_WITH_UNDERSCORE, ignoredFields = { "id",
"create_time" }, dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'", timeZone = "PDT", numberFormat = "#.###", enumerated = EnumBy.ORDINAL)
@Table("UserQueryAllResult")
public class UserQueryAllResult {

Expand All @@ -51,10 +52,10 @@ public class UserQueryAllResult {
@Type(name = "List<String>")
private java.util.Date create_time;

// test
private List<User> users;

private Set<User> userSet; // test
// test
private List<User> users;

private Set<User> userSet; // test

public UserQueryAllResult copy() {
final UserQueryAllResult copy = new UserQueryAllResult();
Expand Down
7 changes: 2 additions & 5 deletions samples/com/landawn/abacus/samples/DaoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void test_exportCSV() throws Exception {
try (Connection conn = JdbcTest.dataSource.getConnection();
PreparedStatement stmt = conn.prepareStatement("select * from user1");
ResultSet rs = stmt.executeQuery()) {
JdbcUtils.exportCSV(System.out, rs);
JdbcUtils.exportCSV(IOUtil.newOutputStreamWriter(System.out), rs);
}

N.println(IOUtil.LINE_SEPARATOR);
Expand All @@ -376,7 +376,7 @@ public void test_exportCSV() throws Exception {
try (Connection conn = JdbcTest.dataSource.getConnection();
PreparedStatement stmt = conn.prepareStatement("select * from user1");
ResultSet rs = stmt.executeQuery()) {
JdbcUtils.exportCSV(System.out, rs, 0, 10, true, false);
JdbcUtils.exportCSV(IOUtil.newOutputStreamWriter(System.out), rs, JdbcUtil.getColumnLabelList(rs), true, false);
}

userDao.batchDelete(users);
Expand Down Expand Up @@ -1335,9 +1335,6 @@ public void test_joinedBy_2() throws SQLException {
userDao.batchDelete(users);
}

/**
*
*/
@Test
public void test_SQLParser() {
final String sql = "SELECT employee_id AS \"employeeId\", first_name AS \"firstName\", last_name AS \"lastName\" FROM employee WHERE 1 < 2";
Expand Down
3 changes: 0 additions & 3 deletions samples/com/landawn/abacus/samples/DataSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
public class DataSetTest {
static final Random RAND = new Random();

/**
*
*/
@Test
public void test_join() {
final User user = User.builder().id(1001).firstName("Tom").build();
Expand Down
39 changes: 0 additions & 39 deletions samples/com/landawn/abacus/samples/UncheckedDaoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ public void test_define() throws SQLException {
// assertEquals(N.asList(sql), uncheckedUserDao.getCachedSqls("selectById"));
// }

/**
*
*/
@Test
public void test_orderBy() {
JdbcUtil.enableSqlLog();
Expand All @@ -129,9 +126,6 @@ public void test_orderBy() {
assertFalse(uncheckedUserDao.exists(id));
}

/**
*
*/
@Test
public void test_cache() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand All @@ -153,9 +147,6 @@ public void test_cache() {
uncheckedUserDao.delete(userFromDB);
}

/**
*
*/
@Test
public void test_handler() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand All @@ -178,9 +169,6 @@ public void test_handler() {
assertFalse(uncheckedUserDao.exists(userFromDB.getId()));
}

/**
*
*/
@Test
public void test_sql_log() {

Expand Down Expand Up @@ -210,9 +198,6 @@ public void test_sql_log() {
});
}

/**
*
*/
@Test
public void test_operation_log() {

Expand All @@ -222,9 +207,6 @@ public void test_operation_log() {
uncheckedUserDao.delete_propagation_SUPPORTS(100);
}

/**
*
*/
@Test
public void test_propagation() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand Down Expand Up @@ -298,9 +280,6 @@ public void test_batch() throws SQLException {
assertEquals(0, N.sum(uncheckedUserDao.batchDeleteByIds_2(ids)));
}

/**
*
*/
@Test
public void test_save_insert() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand All @@ -321,9 +300,6 @@ public void test_save_insert() {
assertFalse(uncheckedUserDao.exists(id));
}

/**
*
*/
@Test
public void test_save_insert_2() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand Down Expand Up @@ -404,9 +380,6 @@ public void test_readOnlyDao() throws SQLException {
uncheckedUserDao.delete(user);
}

/**
*
*/
@Test
public void test_batchGet() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand Down Expand Up @@ -438,9 +411,6 @@ public void test_batchGet() {
uncheckedUserDao.deleteById(100L);
}

/**
*
*/
@Test
public void test_batchDelete() {
User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand Down Expand Up @@ -474,9 +444,6 @@ public void test_batchDelete() {
uncheckedUserDao.deleteById(100L);
}

/**
*
*/
@Test
public void test_findFirst() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand Down Expand Up @@ -506,9 +473,6 @@ public void test_findFirst() {
uncheckedUserDao.deleteById(100L);
}

/**
*
*/
@Test
public void test_list() {
final User user = User.builder().id(100).firstName("Forrest").lastName("Gump").email("123@email.com").build();
Expand Down Expand Up @@ -717,9 +681,6 @@ public void crud_joinedBy_2() throws SQLException {
uncheckedUserDao.batchDelete(users);
}

/**
*
*/
@Test
public void test_SQLParser() {
final String sql = "SELECT employee_id AS \"employeeId\", first_name AS \"firstName\", last_name AS \"lastName\" FROM employee WHERE 1 < 2";
Expand Down
Loading

0 comments on commit a4f848f

Please sign in to comment.