Kab kev ntxub ntxaug yog dab tsi?

Cov txheej txheem:

Kab kev ntxub ntxaug yog dab tsi?
Kab kev ntxub ntxaug yog dab tsi?
Anonim

Kab kev ntxub ntxaug nws tus kheej yog siv kom paub qhov txawv ntawm cov chav kawm sib txawv thaum cov chav kawm hierarchies yog mapped ca los yog ntsug. Lub tswv yim tom qab lub tiaj tiaj thiab ntsug daim duab qhia yog tias txhua chav kawm yog mapped rau hauv ib kab nyob rau hauv lub hauv paus chav kawm ntawv. Tus nqi sib cais yog siv los txhais hom ntawm txhua kab.

Koj pom kab neeg ntxub ntxaug li cas?

The entity definition: @Entity(name="Port") @DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType. STRING, length=10) @DiscriminatorValue(value="port") @Table(name="vPorts") @XmlRootElement(name="port") pej xeem chav PortEntity { …

Dab tsi yog kev ntxub ntxaug hauv Java?

Annotation Type DiscriminatorColumn

Qhia cov kab kev ntxub ntxaug rau SINGLE_TABLE thiab JOINED Inheritance maping strategies. Lub tswv yim thiab cov kab kev ntxub ntxaug tsuas yog teev nyob rau hauv lub hauv paus ntawm ib qho chaw hauv chav kawm hierarchy lossis subhierarchy uas siv cov tswv yim sib txawv ntawm qub txeeg qub teg.

Dab tsi yog siv kab kev ntxub ntxaug hauv Hibernate?

Yog tias koj xav siv lub tswv yim no nrog JPA, koj lub rooj ntaub ntawv yuav tsum muaj kab kev ntxub ntxaug. Tus nqi hauv kab ntawv no txheeb xyuas cov chav kawm uas txhua cov ntaub ntawv yuav tsum tau kos npe. Los ntawm lub neej ntawd, Hibernate siv tib txoj hauv kev.

siv @DiscriminatorColumn yog dab tsi?

Discriminator yognquag siv hauv SINGLE_TABLE qub txeeg qub teg vim tias koj xav tau ib kab los txheeb xyuas hom ntaub ntawv. Piv txwv li: Koj muaj ib chav Me Nyuam Kawm Ntawv thiab 2 chav kawm sub: GoodStudent thiab BadStudent.

Hibernate Tip: SINGLE_TABLE strategy without discriminator column

Hibernate Tip: SINGLE_TABLE strategy without discriminator column
Hibernate Tip: SINGLE_TABLE strategy without discriminator column
39 cov lus nug ntsig txog pom

Pom zoo: