package com.jpa.jpaspringboot.service.Impl;

import com.jpa.jpaspringboot.dao.UserDao;
import com.jpa.jpaspringboot.entity.User;
import com.jpa.jpaspringboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;


    @Override
    public List<User> find() {
        return userDao.findAll();
    }

    @Override
    public void add() {
        User user = new User();
        user.setSex("男");
        user.setName("436");
        user.setId(12);
        user.setName("哈哈哈");
        userDao.save(user);
    }
}
