Skip to content

Instantly share code, notes, and snippets.

View Pudding124's full-sized avatar
🏠
Working from home

Ming-jen, Hsu Pudding124

🏠
Working from home
  • Trend Micro Inc.
  • Taiwan
View GitHub Profile
@Pudding124
Pudding124 / stackoverflow_state.md
Last active August 24, 2022 12:18
Stack Overflow Stats

❤️ [java] [javaparser] ❤️ --- Stack Overflow Stats --- 🥇 0 | Reputation: 73 🥈 1 | Questions: 3 🥉 8 | Answers: 1

@Pudding124
Pudding124 / leetcode_solved_list.md
Last active August 24, 2022 12:18
Leetcode Solved List

Total Solved Problem 🎉 345 🎉 --- Solved Problem List --- Easy 🌕 🌕 🌘 🌑 🌑 🌑 🌑 🌑 🌑 🌑 21% [129] Medium 🌕 🌗 🌑 🌑 🌑 🌑 🌑 🌑 🌑 🌑 15% [198] Hard 🌘 🌑 🌑 🌑 🌑 🌑 🌑 🌑 🌑 🌑 3% [18]

<%--
Created by IntelliJ IDEA.
User: surpr
Date: 2020/4/20
Time: 下午 01:16
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
package action;
import dao.CarDao;
import model.Car;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class CarSaveAction {
String name;
String number;
<%--
Created by IntelliJ IDEA.
User: surpr
Date: 2020/4/19
Time: 下午 08:43
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
package action;
import dao.CarDao;
import model.Car;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class CarAction {
String name;
String number;
package model;
public class Car {
private Long id;
private String name;
private String number;
public Car() {}
public Long getId() {
package dao;
import model.Car;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.HibernateUtil;
public class CarDaoImpl implements CarDao {
package dao;
import model.Car;
public interface CarDao {
void save(Car car);
Car carQuery(String number);
}
package util;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
public class HibernateUtil {
private static SessionFactory sessionFactory;
static {