摘要: public void testSelect(){ User user = new User(); List<User> list=newMapper.Select(user); for(User u:list){ System.out.println(u); } } //查询多个对象,返回值为Li 阅读全文
posted @ 2020-08-17 15:23 yuanzhinv01 阅读(875) 评论(0) 推荐(0)
摘要: public void testSelectByPrimaryKey() { //1.提供id值 Integer id = 3; //2.执行根据主键进行的查询 User u = newMapper.selectByPrimaryKey(id); //3.打印结果 System.out.printl 阅读全文
posted @ 2020-08-17 15:19 yuanzhinv01 阅读(436) 评论(0) 推荐(0)
摘要: selectOne()查询单个对象,返回实体类对象 public void testSelectOne(){ User u=new User(); u.setId(666); User selectOne = newMapper.selectOne(u); System.out.println(se 阅读全文
posted @ 2020-08-17 15:14 yuanzhinv01 阅读(18667) 评论(1) 推荐(0)
摘要: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; 阅读全文
posted @ 2020-08-17 14:31 yuanzhinv01 阅读(980) 评论(0) 推荐(0)
摘要: 作用:替我们生成增删改查的sql语句。 添加mybatis依赖: <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>版本号</version> </dependency> 在 m 阅读全文
posted @ 2020-08-17 11:14 yuanzhinv01 阅读(142) 评论(0) 推荐(0)
摘要: public class Test { public static void main(String args[]) { String str = "helloworld"; char[] data = str.toCharArray();// 将字符串转为数组 for (int x = 0; x 阅读全文
posted @ 2020-08-13 16:37 yuanzhinv01 阅读(803) 评论(0) 推荐(0)
摘要: java.util.Arrays 类能方便地操作数组,它提供的所有方法都是静态的。 1. public static boolean equals(long[] a, long[] a2); 如果两个指定的 long 型数组彼此相等,则返回 true。如果两个数组包含相同数量的元素,并且两个数组中的 阅读全文
posted @ 2020-08-13 16:33 yuanzhinv01 阅读(147) 评论(0) 推荐(0)
摘要: public static int[] reverse(int[] list) { int[] result = new int[list.length]; for (int i = 0, j = result.length - 1; i < list.length; i++, j--) { res 阅读全文
posted @ 2020-08-13 16:23 yuanzhinv01 阅读(512) 评论(0) 推荐(0)
摘要: 声明数组变量 dataType[] arrayRefVar; // 首选的方法 int[] myList; double[] myList; 创建数组 dataType[] arrayRefVar = new dataType[size]; 举个栗子: public class TestArray 阅读全文
posted @ 2020-08-13 16:03 yuanzhinv01 阅读(117) 评论(0) 推荐(0)
摘要: 1.char charAt(int i) 返回制定索引处的char值。 2.int compareTo(Object o) 把这个字符串和另一个对象做对比。 3.int compareTo(String anotherstring)按字典顺序比较两个字符串。 4.int compareTolgnor 阅读全文
posted @ 2020-08-13 15:47 yuanzhinv01 阅读(67) 评论(0) 推荐(0)