2006年04月17日
partech 写道:
赫赫,这和持久层有啥关系?





Specification 控“实”之“虚”


http://forum.javaeye.com/viewtopic.php?p=117769&highlight=#117769



你这篇文章正好可以秀给楼主啊 Laughing



从partech的文章可以看到,这里的关键是对课程这个术语分离出"抽象"


跟"具体"的概念。



如果业务上所涉及的要素(学期1、教室2、班级3、教师4)与课程(top)的组合很灵活,可以逐级join的方式设计。join table作为业务对象看待(从持久层的角度,每个是一个table),类似这样:


(top join 1) as t1


(2 join t1) as t2


(3 join t2) as t3


…..



从OO的角度,有点像Course、CourseInstance、CourseInstanceInstance…



夸张的考虑。



实际可能特定要素直接作为属性;也可能多个要素join在同一处。

2006年03月29日
2006年01月20日

first,I want to add an unique set like following:
alter table section add constraint section_name_seating_chart_unique unique(name,seating_chart_id);

an error occurs:
Duplicate entry ‘Producer’s Assistant-40′ for key 2

I find an article mentions it:
http://wwwprog.chez-alice.fr/mysql.htm

!!! Strange stuff with UNIQUE KEY and the MODIFY:
If you plan to modify a column which is included into unique set then you shoulddrop the index given the first column refered into the unique key then apply the change


alter table section drop index SECTION_SEATING_CHART_FK;

when I run above,another error occurs:

Error on rename of ‘.\trs\#sql-42c_21′ to ‘.\trs\section’ (errno: 150)

though some talked about that,none tell me why and how.
at last,I throw the project away,and make validation with Hibernate,everything ok,but I am unhappy.


alter table section drop index SECTION_SEATING_CHART_FK;

when I run above,another error occurs:

Error on rename of ‘.\trs\#sql-42c_21′ to ‘.\trs\section’ (errno: 150)

though some talked about that,none tell me why and how.
at last,I throw the project away,and make validation with Hibernate,everything ok,but I am unhappy.