關於dao模組中的Mapping檔案該怎麼設定

2021-10-09 02:52:56 字數 801 閱讀 6528

<?xml version="1.0" encoding="utf-8" ?>

name,

status

select from t_product_type

select from t_product_type

where id=#

insert into t_product_type

(name,status)

values

(#,#)

update t_product_type

set name=#

where id=#

update t_product_type

set status=#

where id=#

delete from t_product_type

where id=#

定義乙個sql的id

id,

name,

status

其中id,name,status這些是當前頁面的三個屬性。

select from t_product_type

這個id名字就是dao裡面乙個檔案的名字(producttypedao檔案裡面的乙個方法的名字),裡面就是它的方法select從這個sql裡面進行select,typecolum就是這個sql的id,在這裡寫好後會被直接呼叫,然而下面的form t_product_type就表示資料庫裡面的乙個資料的名稱

下面是一樣的道理

關於Service和Dao的關係

在新的專案裡,沒有辦法理解service和dao的意義,今天在晚上查詢了一下 service層的作用,在jdon上搜到了一篇帖子,層的職責的請教,看到了裡面的一些討論,自己對這兩個層次的劃分也明確了許多。service層是業務邏輯,包括對一些資料的預處理啊,這樣的一層也便於以後業務變化後,改動的代價...

Python中關於模組的 name

在python的每個模組中,都內建了很多變數,其中有乙個就是 name 變數。該變數在模組被匯入或直接執行時,其值是不一樣的 比如有乙個模組test debug true class fooclass object foo class pass def test test function if d...

關於python中的tkinter模組

python2.7和python3.6中的tkinter是兩個包,不會自動公升級,假如在fedora28做開發的話,錯誤 用import tkinter import tkinter import tkinter 都會失敗,網上的解決辦法 1.yum install python tk 這裡預設安裝...