Hibenate代码没有错误,但没有创建表并显示很少的日志记录错误

时间:2018-01-28 16:53:32

标签: java mysql spring hibernate jdbc

我正在尝试通过Hibenate创建一个表,并且我已经使用注释在DAO和Model类中编写了代码,服务器运行正常,但是没有创建表。我正在将Spring与Hibernate集成,因此,想知道错误/日志是什么以及问题在项目中的位置。提前致谢

以下是记录器抛出的错误:

ContextLoader - Root WebApplicationContext: initialization started
XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Sun Jan 28 11:21:44 EST 2018]; root of context hierarchy
XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [com/hospital/config/dao-context.xml]
ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
PropertyPlaceholderConfigurer - Loading properties file from class path resource [hibconfig.properties]
DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5fefc31: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,patientDAO,org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,transactionManager,sessionFactory,dataSource]; root of factory hierarchy
DriverManagerDataSource - Loaded JDBC driver: com.mysql.jdbc.Driver
Version - Hibernate Commons Annotations 3.2.0.Final
Environment - Hibernate 3.6.10.Final
Environment - hibernate.properties not found
Environment - Bytecode provider name : javassist
Environment - using JDK 1.4 java.sql.Timestamp handling
AnnotationBinder - Binding entity from annotated class: com.hospital.model.Patient
EntityBinder - Bind entity com.hospital.model.Patient on table Patient
AnnotationBinder - Binding entity from annotated class: com.hospital.model.InPatient
EntityBinder - Bind entity com.hospital.model.InPatient on table InPatient
AnnotationBinder - Binding entity from annotated class: com.hospital.model.OutPatient
EntityBinder - Bind entity com.hospital.model.OutPatient on table OutPatient
Configuration - Hibernate Validator not found: ignoring
AnnotationSessionFactoryBean - Building new Hibernate SessionFactory
HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
ConnectionProviderFactory - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
JDBCExceptionReporter - SQL Error: 1045, SQLState: 28000
JDBCExceptionReporter - Access denied for user 'root'@'localhost' (using password: YES)
SettingsFactory - Could not obtain connection to query metadata
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:943)
    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4113)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1308)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2336)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2369)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)
    at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:164)
    at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
    at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)
    at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:113)
    at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5105)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
JdbcSupportLoader - Disabling contextual LOB creation as connection was null
TransactionFactoryFactory - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
SettingsFactory - Automatic flush during beforeCompletion(): disabled
SettingsFactory - Automatic session close at end of transaction: disabled
SettingsFactory - Scrollable result sets: disabled
SettingsFactory - JDBC3 getGeneratedKeys(): disabled
SettingsFactory - Connection release mode: auto
SettingsFactory - Maximum outer join fetch depth: 2
SettingsFactory - Default batch fetch size: 1
SettingsFactory - Generate SQL with comments: disabled
SettingsFactory - Order SQL updates by primary key: disabled
SettingsFactory - Order SQL inserts for batching: disabled
SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
SettingsFactory - Query language substitutions: {}
SettingsFactory - JPA-QL strict compliance: disabled
SettingsFactory - Second-level cache: enabled
SettingsFactory - Query cache: disabled
SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
SettingsFactory - Optimize cache for minimal puts: disabled
SettingsFactory - Structured second-level cache entries: disabled
SettingsFactory - Echoing all SQL to stdout
SettingsFactory - Statistics: disabled
SettingsFactory - Deleted entity synthetic identifier rollback: disabled
SettingsFactory - Default entity-mode: pojo
SettingsFactory - Named query checking : enabled
SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
SessionFactoryImpl - building session factory
BasicTypeRegistry - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@84b9aec
BasicTypeRegistry - Type registration [clob] overrides previous : org.hibernate.type.ClobType@656ea219
BasicTypeRegistry - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@656ea219
BasicTypeRegistry - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@3f372405
BasicTypeRegistry - Type registration [blob] overrides previous : org.hibernate.type.BlobType@75b81c7d
BasicTypeRegistry - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@75b81c7d
BasicTypeRegistry - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@21f064dc
BasicTypeRegistry - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@319e7491
BasicTypeRegistry - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@378f69ab
PojoInstantiator - no default (no-argument) constructor for class: com.hospital.model.InPatient (class must be instantiated by Interceptor)
SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
HibernateTransactionManager - Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@30020ae3] of Hibernate SessionFactory for HibernateTransactionManager
ContextLoader - Root WebApplicationContext: initialization completed in 3282 ms
Jan 28, 2018 11:21:47 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
DispatcherServlet - FrameworkServlet 'dispatcher': initialization started
XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun Jan 28 11:21:47 EST 2018]; parent: Root WebApplicationContext
XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@dae3613: defining beans [ViewResolver,adminController,databaseErrorHandler,doctorController,loginController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@5fefc31
DefaultAnnotationHandlerMapping - Mapped URL path [/newPatient] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/newPatient.*] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/newPatient/] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/patient] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/patient.*] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/patient/] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/admin] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/admin.*] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/admin/] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/patientdashboard] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/patientdashboard.*] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/patientdashboard/] onto handler 'adminController'
DefaultAnnotationHandlerMapping - Mapped URL path [/newDoctor] onto handler 'doctorController'
DefaultAnnotationHandlerMapping - Mapped URL path [/newDoctor.*] onto handler 'doctorController'
DefaultAnnotationHandlerMapping - Mapped URL path [/newDoctor/] onto handler 'doctorController'
DefaultAnnotationHandlerMapping - Mapped URL path [/login] onto handler 'loginController'
DefaultAnnotationHandlerMapping - Mapped URL path [/login.*] onto handler 'loginController'
DefaultAnnotationHandlerMapping - Mapped URL path [/login/] onto handler 'loginController'
DefaultAnnotationHandlerMapping - Mapped URL path [/register] onto handler 'loginController'
DefaultAnnotationHandlerMapping - Mapped URL path [/register.*] onto handler 'loginController'
DefaultAnnotationHandlerMapping - Mapped URL path [/register/] onto handler 'loginController'
DispatcherServlet - FrameworkServlet 'dispatcher': initialization completed in 366 ms

hibernate属性文件:

 ################### JDBC Configuration ##########################
    jdbc.driverClassName=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/hospital
    jdbc.username=root
    jdbc.password=Project9  


    ################### Hibernate Configuration ##########################
    hibernate.dialect=org.hibernate.dialect.MySQLDialect
    hibernate.show_sql=true
    hibernate.hbm2ddl.auto=update
    hibernate.generate_statistics=true

映射DAO-context.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-3.0.xsd
            http://www.springframework.org/schema/tx 
            http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
            http://www.springframework.org/schema/mvc 
            http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">


    <context:annotation-config></context:annotation-config>
    <context:component-scan base-package="com.hospital.DAO, com.hospital.model, com.hospital.properties"></context:component-scan>

    <mvc:annotation-driven />

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="location">
    <value>classpath:/hibconfig.properties</value>
  </property>
</bean>

    <tx:annotation-driven transaction-manager="transactionManager" />

    <bean   id="transactionManager" 
            class="org.springframework.orm.hibernate3.HibernateTransactionManager" 
            p:sessionFactory-ref="sessionFactory" />

    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="hibernateProperties">
          <props>        
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>          
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
           </props>
        </property>

        <property name="packagesToScan" value="com.hospital.config,com.hospital.Controller,com.hospital.DAO,com.hospital.model"></property>
    </bean>


    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
            p:driverClassName="${jdbc.driverClassName}"
            p:url="${jdbc.url}"
            p:username="${jdbc.username}"
            p:password="${jdbc.password}"/>




</beans>

PATIENT DAO

package com.hospital.DAO;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;


import com.hospital.model.Patient;

@Repository
@Transactional
public class PatientDAO {


    @Autowired
    private SessionFactory sessionFactory;

    public int save(Patient patient)
    {
        return (Integer) sessionFactory.getCurrentSession().save(patient);
    }

    /*
    public Patient getId(int id)
    {
        return (Patient) sessionFactory.getCurrentSession().get(Patient.class, id);
    }

    public int save(Patient patient)
    {
        return (Integer) sessionFactory.getCurrentSession().save(patient);
    }
*/
}

患者模型:

package com.hospital.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

@Entity
@Table(name="Patient")
@Inheritance(strategy = InheritanceType.JOINED)
public class Patient {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int patientid;
    @Column(name="Patient Name")
    private String pname;
    @Column(name="Age")
    private String age;
    @Column(name="Address")
    private String address;
    @Column(name="Phone Number")
    private String phoneNumber;
    @Column(name="SEX")
    private String patientSEX;
    @Column(name="Disease")
    private String disease;


    public Patient() {
        //super();
    }
    public int getPatientid() {
        return patientid;
    }
    public void setPatientid(int patientid) {
        this.patientid = patientid;
    }
    public String getPname() {
        return pname;
    }
    public void setPname(String pname) {
        this.pname = pname;
    }
    public String getAge() {
        return age;
    }
    public void setAge(String age) {
        this.age = age;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getPhoneNumber() {
        return phoneNumber;
    }
    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }
    public String getPatientSEX() {
        return patientSEX;
    }
    public void setPatientSEX(String patientSEX) {
        this.patientSEX = patientSEX;
    }
    public String getDisease() {
        return disease;
    }
    public void setDisease(String disease) {
        this.disease = disease;
    }
    public Patient(String pname, String age, String address, String phoneNumber, String patientSEX, String disease) {
        super();
        this.pname = pname;
        this.age = age;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.patientSEX = patientSEX;
        this.disease = disease;
    }





}

0 个答案:

没有答案