Browse Source

model层增加index,字段类型调整

wangyc 8 years ago
parent
commit
752cc8bd8d

+ 3 - 3
src/main/java/com/uas/platform/b2c/prod/product/brand/modal/Brand.java

@@ -13,7 +13,7 @@ import java.util.Date;
  * @version  2016年3月11日上午9:30:00 suntg 创建
  */
 @Entity
-@Table(name = "product$brand")
+@Table(name = "product$brand", indexes = { @Index(name = "product$brand_inital", columnList = "br_inital"), @Index(name = "product$brand_namecn_uni", columnList = "br_name_cn", unique = true), @Index(name = "product$brand_nameen_uni", columnList = "br_name_en", unique = true)})
 public class Brand implements Serializable {
 
 	/**
@@ -38,13 +38,13 @@ public class Brand implements Serializable {
 	/**
 	 * 品牌中文名称
 	 */
-	@Column(name = "br_name_cn")
+	@Column(name = "br_name_cn", unique = true)
 	private String nameCn;
 
 	/**
 	 * 品牌英文名称
 	 */
-	@Column(name = "br_name_en")
+	@Column(name = "br_name_en", unique = true)
 	private String nameEn;
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/product/component/modal/Component.java

@@ -19,7 +19,7 @@ import java.util.Set;
  * @version  2016年3月11日上午10:24:29 suntg 创建
  */
 @Entity
-@Table(name = "product$component")
+@Table(name = "product$component", indexes = { @Index(name = "BRID_CODE_UNIQUE", columnList = "cmp_code,cmp_brid", unique = true), @Index(name = "PRODUCT$COMPONENT_CODE", columnList = "cmp_code")})
 public class Component implements Serializable {
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentCrawl.java

@@ -13,7 +13,7 @@ import java.util.Set;
  * @version  2016年10月27日上午10:18:16 wangyc 创建
  */
 @Entity
-@Table(name = "product$component_crawl")
+@Table(name = "product$component_crawl", indexes = { @Index(name = "PRODUCT$COMPONENT_CRAWL_TASK", columnList = "cc_task")})
 public class ComponentCrawl implements Serializable {
 
 	private static final long serialVersionUID = 1L;

+ 5 - 5
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentVersion.java

@@ -39,7 +39,7 @@ public class ComponentVersion implements Serializable {
 	/**
 	 * 标准器件唯一标识符UUID
 	 */
-	@Column(name = "cmp_uuid", unique = true)
+	@Column(name = "cmp_uuid")
 	private String uuid;
 
 	/**
@@ -70,7 +70,7 @@ public class ComponentVersion implements Serializable {
 	 * 创建人对应的Json字符串
 	 */
 	@Lob
-	@Column(name = "cmp_defineuserJson")
+	@Column(name = "cmp_defineuserJson", length = 2000)
 	private String defineuserJson;
 
 	/**
@@ -83,7 +83,7 @@ public class ComponentVersion implements Serializable {
 	 * 最近更新人对应的Json字符串
 	 */
 	@Lob
-	@Column(name = "cmp_modifyuserJson")
+	@Column(name = "cmp_modifyuserJson", length = 2000)
 	private String modifyuserJson;
 
 	/**
@@ -121,7 +121,7 @@ public class ComponentVersion implements Serializable {
 	 * 详细描述
 	 */
 	@Lob
-	@Column(name = "cmp_description")
+	@Column(name = "cmp_description", columnDefinition = "TEXT")
 	private String description;
 
 	/**
@@ -148,7 +148,7 @@ public class ComponentVersion implements Serializable {
 	 * 为了前端解析展示的便利,将$scope.properties转换成字符串保存下来,这样直接在前端解析后便可以使用统一的数据格式&样式等
 	 */
 	@Lob
-	@Column(name = "properties_json")
+	@Column(name = "properties_json", columnDefinition = "LONGBLOB")
 	private String propertiesJson;
 
 	public Long getId() {

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/product/property/model/PropertyValue.java

@@ -9,7 +9,7 @@ import javax.persistence.*;
  * @version  2016年3月11日下午2:24:29 suntg 创建
  */
 @Entity
-@Table(name = "product$propertyvalue")
+@Table(name = "product$propertyvalue", indexes = { @Index(name = "PROPERTYVALUE_P_CMP_INDEX", columnList = "pv_componentid,pv_propertyid"), @Index(name = "PROPERTYVALUE_CMPID_INDEX", columnList = "pv_componentid"), @Index(name = "PROPERTYVALUE_VALUE_INDEX", columnList = "pv_value")})
 public class PropertyValue {
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/product/property/model/PropertyValueSubmit.java

@@ -64,7 +64,7 @@ public class PropertyValueSubmit implements Serializable {
 	/**
 	 * 属性值
 	 */
-	@Column(name = "ps_value")
+	@Column(name = "ps_value", length = 500)
 	private String stringValue;
 
 	/**

+ 1 - 1
src/main/resources/META-INF/persistence.xml

@@ -16,7 +16,7 @@
 				to modify an existing database; value="create-drop" means the same as "create" 
 				but also drops tables when Hibernate closes; value="validate" makes no changes 
 				to the database -->
-			<property name="hibernate.hbm2ddl.auto" value="create" />
+			<property name="hibernate.hbm2ddl.auto" value="update" />
 			<property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy" />
 			<property name="hibernate.connection.charSet" value="UTF-8" />
 			<!-- Uncomment the following two properties for JBoss only -->

+ 1 - 1
src/main/resources/dev/jdbc.properties

@@ -1,6 +1,6 @@
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.url=jdbc:mysql://192.168.253.12:3306/mall_test_wyc
+jdbc.url=jdbc:mysql://192.168.253.12:3306/mall_test
 jdbc.username=root
 jdbc.password=select111***
 jdbc.initialSize=1