ORACLE: 1.查主键名称: select * from user_constraints where table_name = 'AAA' and constraint_type ='P'; 查主键对应的列: select * from user_cons_columns where table_name = 'AAA' and constraint_name = 'PK_AAA'; (PK_AAA 是主键名) 2.查索引名称: select * from user_indexes whe
网上搜了好多文章照着弄都返回不了主键给map, 实践证明要在传入的map参数里写回插入的主键,要这样写 <selectKey resultType="java.lang.Integer" order="BEFORE" keyProperty="col.id"> // keyProperty要指定为map参数的 名称.写回的键名 才行 SELECT SEQ_LOG.nextval AS id FROM DUA
一个自增长ID的对象被save或者persist后,会返回其主键ID: Department department = new Department(); department.setName("xxxxxxx"); session.persist(department); System.out.println("id = " + department2.getId()); Department department2 = new Department(); dep