[jbosstools-commits] JBoss Tools SVN: r43486 - workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Sep 6 19:31:40 EDT 2012


Author: akazakov
Date: 2012-09-06 19:31:40 -0400 (Thu, 06 Sep 2012)
New Revision: 43486

Added:
   workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/QualifierEntity.java
Modified:
   workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/BeanEntity.java
   workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/TypeEntity.java
Log:
https://issues.jboss.org/browse/JBIDE-12446

Modified: workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/BeanEntity.java
===================================================================
--- workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/BeanEntity.java	2012-09-06 22:59:09 UTC (rev 43485)
+++ workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/BeanEntity.java	2012-09-06 23:31:40 UTC (rev 43486)
@@ -16,6 +16,8 @@
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
 
 /**
  * @author Alexey Kazakov
@@ -24,9 +26,10 @@
 public class BeanEntity {
 
 	private long id;
-	private long index;
+	private int index;
+	private short projectIndex;
 	private List<TypeEntity> types;
-	private List<TypeEntity> qualifiers;
+	private List<QualifierEntity> qualifiers;
 
 	/**
 	 * @return the id
@@ -45,18 +48,20 @@
 		this.id = id;
 	}
 
-	@Column
-	public long getIndex() {
+	@Column(unique=true)
+	public int getIndex() {
 		return index;
 	}
 
-	public void setIndex(long index) {
+	public void setIndex(int index) {
 		this.index = index;
 	}
 
 	/**
 	 * @return the types
 	 */
+	@ManyToMany
+	@JoinColumn(nullable=true)
 	public List<TypeEntity> getTypes() {
 		return types;
 	}
@@ -71,14 +76,41 @@
 	/**
 	 * @return the qualifiers
 	 */
-	public List<TypeEntity> getQualifiers() {
+	@ManyToMany
+	@JoinColumn(nullable=true)
+	public List<QualifierEntity> getQualifiers() {
 		return qualifiers;
 	}
 
 	/**
 	 * @param qualifiers the qualifiers to set
 	 */
-	public void setQualifiers(List<TypeEntity> qualifiers) {
+	public void setQualifiers(List<QualifierEntity> qualifiers) {
 		this.qualifiers = qualifiers;
 	}
+
+	/**
+	 * @return the projectIndex
+	 */
+	@Column(nullable=false)
+	public short getProjectIndex() {
+		return projectIndex;
+	}
+
+	/**
+	 * @param projectIndex the projectIndex to set
+	 */
+	public void setProjectIndex(short projectIndex) {
+		this.projectIndex = projectIndex;
+	}
+
+	@Override
+	public int hashCode() {
+		return index;
+	}
+
+	@Override
+	public String toString() {
+		return "" + index;
+	}
 }
\ No newline at end of file

Added: workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/QualifierEntity.java
===================================================================
--- workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/QualifierEntity.java	                        (rev 0)
+++ workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/QualifierEntity.java	2012-09-06 23:31:40 UTC (rev 43486)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.db.entity;
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class QualifierEntity {
+
+	private long id;
+	private int index;
+	private short projectIndex;
+
+	/**
+	 * @return the id
+	 */
+	@Id
+	@GeneratedValue
+	@Column
+	public long getId() {
+		return id;
+	}
+
+	/**
+	 * @param id the id to set
+	 */
+	public void setId(long id) {
+		this.id = id;
+	}
+
+	@Column(unique=true)
+	public int getIndex() {
+		return index;
+	}
+
+	public void setIndex(int index) {
+		this.index = index;
+	}
+
+	/**
+	 * @return the projectIndex
+	 */
+	@Column(nullable=false)
+	public short getProjectIndex() {
+		return projectIndex;
+	}
+
+	/**
+	 * @param projectIndex the projectIndex to set
+	 */
+	public void setProjectIndex(short projectIndex) {
+		this.projectIndex = projectIndex;
+	}
+
+	@Override
+	public int hashCode() {
+		return index;
+	}
+
+	@Override
+	public String toString() {
+		return "" + index;
+	}
+}
\ No newline at end of file


Property changes on: workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/QualifierEntity.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/TypeEntity.java
===================================================================
--- workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/TypeEntity.java	2012-09-06 22:59:09 UTC (rev 43485)
+++ workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/entity/TypeEntity.java	2012-09-06 23:31:40 UTC (rev 43486)
@@ -22,7 +22,8 @@
 public class TypeEntity {
 
 	private long id;
-	private long index;
+	private int index;
+	private short projectIndex;
 
 	/**
 	 * @return the id
@@ -41,12 +42,37 @@
 		this.id = id;
 	}
 
-	@Column
-	public long getIndex() {
+	@Column(unique=true)
+	public int getIndex() {
 		return index;
 	}
 
-	public void setIndex(long index) {
+	public void setIndex(int index) {
 		this.index = index;
 	}
+
+	/**
+	 * @return the projectIndex
+	 */
+	@Column(nullable=false)
+	public short getProjectIndex() {
+		return projectIndex;
+	}
+
+	/**
+	 * @param projectIndex the projectIndex to set
+	 */
+	public void setProjectIndex(short projectIndex) {
+		this.projectIndex = projectIndex;
+	}
+
+	@Override
+	public int hashCode() {
+		return index;
+	}
+
+	@Override
+	public String toString() {
+		return "" + index;
+	}
 }
\ No newline at end of file



More information about the jbosstools-commits mailing list