1.hibernate åeclipselinkçåºå«
hibernate åeclipselinkçåºå«
Hibernate
Hibernate æ¯ä¸ä¸ªå¼æ¾æºä»£ç ç对象/å ³ç³»æ å°æ¡æ¶åæ¥è¯¢æå¡ãå®å¯¹ JDBC è¿è¡äºè½»é级ç对象å°è£ ï¼è´è´£ä» Java ç±»æ å°å°æ°æ®åºè¡¨ï¼å¹¶ä» Java æ°æ®ç±»åæ å°å° SQL æ°æ®ç±»åãå¨ 4.0 çæ¬ Hibenate å¼å§æ¯æå¤ç§æ·æ¶æââ对ä¸åç§æ·ä½¿ç¨ç¬ç«æ°æ®åºæç¬ç« Sechmaï¼å¹¶è®¡åå¨ 5.0 ä¸æ¯æå ±äº«æ°æ®è¡¨æ¨¡å¼ã
å¨ Hibernate 4.0 ä¸çå¤ç§æ·æ¨¡å¼æä¸ç§ï¼éè¿ hibernate.multiTenancy å±æ§æä¸é¢å ç§é ç½®ï¼
NONEï¼éå¤ç§æ·ï¼ä¸ºé»è®¤å¼ã
SCHEMAï¼ä¸ä¸ªç§æ·ä¸ä¸ª Schemaã
DATABASEï¼ä¸ä¸ªç§æ·ä¸ä¸ª databaseã
DISCRIMINATORï¼ç§æ·å ±äº«æ°æ®è¡¨ã计åå¨ Hibernate5 ä¸å®ç°
EclipseLink
EclipseLink æ¯ Eclipse åºéä¼ç®¡çä¸çå¼æºæä¹ å±æå¡é¡¹ç®ï¼ä¸º Java å¼å人åä¸åç§æ°æ®æå¡ï¼æ¯å¦ï¼æ°æ®åºãweb servicesã对象XMLæ å°ï¼OXMï¼ãä¼ä¸ä¿¡æ¯ç³»ç»ï¼EISï¼çï¼äº¤äºæä¾äºä¸ä¸ªå¯æ©å±æ¡æ¶ï¼ç®åæ¯æçæä¹ å±æ åä¸å æ¬ï¼
Java Persistence API (JPA)
Java Architecture for XML Binding (JAXB)
Java Connector Architecture (JCA)
Service Data Objects (SDO)
EclipseLink åèº«æ¯ Oracle TopLink,海关溯源码能撕下来 å¹´ Oracle å°åè ç»å¤§é¨åæç®ç»äº Eclipse åºéä¼ï¼æ¬¡å¹´ EclipseLink 被 Sun æéæ为 JPA 2.0 çåèå®ç°ã
注: ç®å EclipseLink2.5 å®å ¨æ¯æ å¹´åå¸ç JPA2.1(JSR ï¼ ã
å¨å®æ´å®ç° JPA æ åä¹å¤ï¼é对 SaaS ç¯å¢ï¼å¨å¤ç§æ·çé离æ¹é¢ EclipseLink æä¾äºå¾å¥½çæ¯æ以åçµæ´»å°è§£å³æ¹æ¡ã
åºç¨ç¨åºé离
é离ç容å¨/åºç¨æå¡å¨
å ±äº«å®¹å¨/åºç¨æå¡å¨çåºç¨ç¨åºé离
åä¸åºç¨ç¨åºå çå ±äº«ç¼åä½é离ç entity manager factory
å ±äº«ç entity manager factory ä½æ¯é离ç entity manager
æ°æ®é离
é离çæ°æ®åº
é离çSchema/表空é´
é离ç表
å ±äº«è¡¨ä½é离çè¡
æ¥è¯¢è¿æ»¤
Oracle Virtual Private Database (VPDï¼
对äºå¤ç§æ·æ°æ®æºé离主è¦æ以ä¸æ¹æ¡
Single-Table Multi-tenancyï¼ä¾é ç§æ·åºååï¼tenant discriminator columnsï¼æ¥é离表çè¡ï¼å®ç°å¤ç§æ·å ±äº«è¡¨ã
Table-Per-Tenant Multi-tenancyï¼ä¾é 表çç§æ·åºå(table tenant discriminator)æ¥é离表ï¼å®ç°ä¸ç§æ·ä¸ä¸ªè¡¨ï¼å¤§ä½ç±»ä¼¼äºä¸æçå ±äº«æ°æ®åºç¬ç«Schema模å¼ã
Virtual Private Databaseï¼VPD ) Multi-tenancyï¼ä¾é Oracle VPD èªèº«çå®å ¨è®¿é®çç¥ï¼åºäºå¨æSQL whereåå¥ç¹æ§ï¼ï¼å®ç°å¤ç§æ·å ±äº«è¡¨ã
æ¨èé 读è¿ç¯æç« ï¼/java/j-lo-dataMultitenant/ï¼è®²çä¸éã