jf框架

package cn.itcast;

import cn.itcast.dao.impl.StudentDaoImpl;
import cn.itcast.dao.impl.UserDaoImpl;
import cn.itcast.domain.Student;
import cn.itcast.domain.User;

public class Test {
    public static void main(String[] args) {
        UserDaoImpl impl=new UserDaoImpl();
        User zhangsan = impl.findUserByUsernameAndPassword("zhangsan", "123456");
        System.out.println(zhangsan);
    }
}
package cn.itcast.dao;

import cn.itcast.domain.Student;

import java.util.List;
import java.util.Map;

/**
 * 用户操作的DAO
 */
public interface StudentDao {


    public List<Student> findAll();

    //Student findUserByUsernameAndPassword(String username, String password);

    void add(Student student);

    void delete(int id);

    Student findById(int i);

    void update(Student student);

    /**
     * 查询总记录数
     * @return
     * @param condition
     */
    int findTotalCount(Map<String, String[]> condition);

    /**
     * 分页查询每页记录
     * @param start
     * @param rows
     * @param condition
     * @return
     */
    List<Student> findByPage(int start, int rows, Map<String, String[]> condition);
}
package cn.itcast.dao;

import cn.itcast.domain.User;

public interface UserDao {
    User findUserByUsernameAndPassword(String username, String password);
    void add(User user);
}

 

posted @ 2024-12-18 09:39  KuanDong24  阅读(3)  评论(0编辑  收藏  举报