首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Django-models & QuerySet API

IntegerField  – 整型 BooleanField  – 布尔值类型 NullBooleanField  – 可以为空的布尔值 CharField     – 字符串类型 必须提供max_length参数,字符长度 TextField      – 文本类型 EmailField     – 一个带有检查 Email 合法性的 CharField GenericIPAddressField      IP地址 URLField        URL类型 SlugField  – 字符串类型,只包含字母,数字,下划线或连字符 CommaSeparatedIntegerField   – 字符串类型,格式必须为逗号分割的数字 UUIDField   uuid类型 DateTimeField     – 日期+时间格式 YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] DateField   – 日期格式 YYYY-MM-DD TimeField   – 时间格式 HH:MM[:ss[.uuuuuu]] FloatField(Field)    – 浮点型 DecimalField(Field)   – 10进制小数 BinaryField(Field)    – 二进制类型

02

SSM框架之MyBatis3专题3:关联

1.1.3 定义Dao层接口 public interface ICountryDao { Country selectCountryById(int cid); } 1.1.4 定义测试类 public class Mytest { private SqlSession session; private ICountryDao dao; @Before public void setUp() { session = MyBatisUtils.getSqlSession(); dao = session.getMapper(ICountryDao.class); } @After public void tearDown() { if(session != null) { session.close(); } } @Test public void test01() { Country country = dao.selectCountryById(1); System.out.println(country); } } 1.1.5 定义映射文件 1、多表连接查询方式 <mapper namespace="com.eason.mybatis.dao.ICountryDao"> <resultMap type="Country" id="countryMapper"> <id column="cid" property="cid"/> <result column="cname" property="cname"/> <collection property="ministers" ofType="Minister"> <id column="mid" property="mid"/> <result column="mname" property="mname"/> </collection> </resultMap> <select id="selectCountryById" resultMap="countryMapper"> select cid, cname, mid, mname from t_country, t_minister where cid=#{xxx} and cid=countryId </select> </mapper>

01
领券