第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

hibernate 查詢時(shí)報(bào)錯(cuò) is not mapped

hibernate 查詢時(shí)報(bào)錯(cuò) is not mapped

錯(cuò)誤 c_grade?is?not?mapped?[from?c_grade//實(shí)體類 package?javabean; //?Generated?2017-4-22?17:53:45?by?Hibernate?Tools?4.3.1.Final import?javax.persistence.Column; import?javax.persistence.Entity; import?javax.persistence.FetchType; import?javax.persistence.GeneratedValue; import?static?javax.persistence.GenerationType.IDENTITY; import?javax.persistence.Id; import?javax.persistence.JoinColumn; import?javax.persistence.ManyToOne; import?javax.persistence.Table; /** ?*?CGrade?generated?by?hbm2java ?*/ @Entity @Table(name?=?"c_grade",?catalog?=?"credit_audit_system") public?class?CGrade?implements?java.io.Serializable?{ private?Integer?gradeId; private?CStudent?CStudent; private?String?courseName; private?Integer?grade; public?CGrade()?{ } public?CGrade(CStudent?CStudent,?String?courseName)?{ this.CStudent?=?CStudent; this.courseName?=?courseName; } public?CGrade(CStudent?CStudent,?String?courseName,?Integer?grade)?{ this.CStudent?=?CStudent; this.courseName?=?courseName; this.grade?=?grade; } @Id @GeneratedValue(strategy?=?IDENTITY) @Column(name?=?"grade_id",?unique?=?true,?nullable?=?false) public?Integer?getGradeId()?{ return?this.gradeId; } public?void?setGradeId(Integer?gradeId)?{ this.gradeId?=?gradeId; } @ManyToOne(fetch?=?FetchType.LAZY) @JoinColumn(name?=?"student_id",?nullable?=?false) public?CStudent?getCStudent()?{ return?this.CStudent; } public?void?setCStudent(CStudent?CStudent)?{ this.CStudent?=?CStudent; } @Column(name?=?"course_name",?nullable?=?false,?length?=?12) public?String?getCourseName()?{ return?this.courseName; } public?void?setCourseName(String?courseName)?{ this.courseName?=?courseName; } @Column(name?=?"grade") public?Integer?getGrade()?{ return?this.grade; } public?void?setGrade(Integer?grade)?{ this.grade?=?grade; } }//配置文件 <?xml?version="1.0"?encoding="UTF-8"?>?? <beans?xmlns="http://www.springframework.org/schema/beans"?xmlns:context="http://www.springframework.org/schema/context"?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xmlns:tx="http://www.springframework.org/schema/tx"?xmlns:aop="http://www.springframework.org/schema/aop"?xsi:schemaLocation="?? http://www.springframework.org/schema/beans??? http://www.springframework.org/schema/beans/spring-beans-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/aop??? http://www.springframework.org/schema/aop/spring-aop-3.0.xsd?? http://www.springframework.org/schema/context???? http://www.springframework.org/schema/context/spring-context-3.1.xsd??? ">?? ?? ????<!--?JNDI(通過Tomcat)方式配置數(shù)據(jù)源?-->?? ????<!--?<bean?id="dataSource"?class="org.springframework.jndi.JndiObjectFactoryBean">?<property?name="jndiName"?value="${jndiName}"></property>?</bean>?-->?? ?????? ?????? ???????<!--?引入屬性文件?-->?? ????<context:property-placeholder?location="classpath:config.properties"?/>?? ???? ?????? ????<!--?配置數(shù)據(jù)源??這里class可以使用不同的驅(qū)動(dòng)-->?? ????<bean?name="dataSource"?class="org.springframework.jdbc.datasource.DriverManagerDataSource">?? ????????<property?name="url"?value="${jdbc_url}"?/>?? ????????<property?name="username"?value="${jdbc_username}"?/>?? ????????<property?name="password"?value="${jdbc_password}"?/> ????</bean>?? ???? ??? ????<!--?配置hibernate?session工廠?-->?? ????<bean?id="sessionFactory"?class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">?? ????????<property?name="dataSource"?ref="dataSource"?/>?? ????????<property?name="hibernateProperties">?? ????????????<props>?? ????????????????<prop?key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>?? ????????????????<prop?key="hibernate.dialect">${hibernate.dialect}</prop>?? ????????????????<prop?key="hibernate.show_sql">${hibernate.show_sql}</prop>?? ????????????????<prop?key="hibernate.format_sql">${hibernate.format_sql}</prop>?? ?????????????????<prop?key="current_session_context_class">thread</prop>???? ?????????????????<prop?key="hibernate.connection.driver_class"?>${driverClassName}</prop>? ????????????</props>?? ????????</property>?? ?? ????????<!--?自動(dòng)掃描注解方式配置的hibernate類文件?-->?? ????????<property?name="packagesToScan">?? ????????????<list>?? ?????????????<!--?此處與entity實(shí)體路徑對(duì)應(yīng)?-->?? ????????????????<value>javabean</value>?? ????????????</list>?? ????????</property>?? ????</bean>?? ???? ???? ?? ????<!--?配置事務(wù)管理器?-->?? ????<bean?name="transactionManager"?class="org.springframework.orm.hibernate4.HibernateTransactionManager">?? ????????<property?name="sessionFactory"?ref="sessionFactory"></property>?? ????</bean>???? ?? ?? ????<!--?注解方式配置事物?-->?? ????<tx:annotation-driven??transaction-manager="transactionManager"?/>??? ?? ?? </beans>
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關(guān)注
  • 2646 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)