java通用dao方法(优化多表联查)

本方法只介绍一个通用方法,本方法可应用在多表联查,可以不用多ji建javaBean也不需要把外键变成对象

  1. 准备一个pet实体类和DBlist工具类

 

package com.pet.entity;

import java.io.Serializable;

public class Pet implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 502943061295576054L;
	
	private Integer pet_id;
	private String pet_name;
	private Integer sort_id;
	private String pet_sex;
	private String pet_introduce;
	private Integer user_id;
	private Integer pet_informationPhoto_power;
	private Integer pet_informationPhoto_ability;
	private Integer pet_informationPhoto_height;
	private Integer pet_informationPhoto_integral;
	public Pet(Integer pet_id, String pet_name, Integer sort_id, String pet_sex, String pet_introduce, Integer user_id,
			Integer pet_informationPhoto_power, Integer pet_informationPhoto_ability,
			Integer pet_informationPhoto_height, Integer pet_informationPhoto_integral) {
		super();
		this.pet_id = pet_id;
		this.pet_name = pet_name;
		this.sort_id = sort_id;
		this.pet_sex = pet_sex;
		this.pet_introduce = pet_introduce;
		this.user_id = user_id;
		this.pet_informationPhoto_power = pet_informationPhoto_power;
		this.pet_informationPhoto_ability = pet_informationPhoto_ability;
		this.pet_informationPhoto_height = pet_informationPhoto_height;
		this.pet_informationPhoto_integral = pet_informationPhoto_integral;
	}
	public Pet(String pet_name, Integer sort_id, String pet_sex, String pet_introduce, Integer user_id,
			Integer pet_informationPhoto_power, Integer pet_informationPhoto_ability,
			Integer pet_informationPhoto_height, Integer pet_informationPhoto_integral) {
		super();
		this.pet_name = pet_name;
		this.sort_id = sort_id;
		this.pet_sex = pet_sex;
		this.pet_introduce = pet_introduce;
		this.user_id = user_id;
		this.pet_informationPhoto_power = pet_informationPhoto_power;
		this.pet_informationPhoto_ability = pet_informationPhoto_ability;
		this.pet_informationPhoto_height = pet_informationPhoto_height;
		this.pet_informationPhoto_integral = pet_informationPhoto_integral;
	}
	public Pet() {
		super();
	}
	public Integer getPet_id() {
		return pet_id;
	}
	public void setPet_id(Integer pet_id) {
		this.pet_id = pet_id;
	}
	public String getPet_name() {
		return pet_name;
	}
	public void setPet_name(String pet_name) {
		this.pet_name = pet_name;
	}
	public Integer getSort_id() {
		return sort_id;
	}
	public void setSort_id(Integer sort_id) {
		this.sort_id = sort_id;
	}
	public String getPet_sex() {
		return pet_sex;
	}
	public void setPet_sex(String pet_sex) {
		this.pet_sex = 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值