From c9e75006df5e669e122424a0e40c5f3af85be9ec Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Sat, 25 Nov 2006 20:44:22 +0000 Subject: [PATCH] Added some more annotations so that intexs and the lob is properly handled git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@479194 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/store/jpa/model/StoredMessage.java | 12 +++++++++--- .../activemq/store/jpa/model/StoredSubscription.java | 5 +++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredMessage.java b/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredMessage.java index ab74462143..385444613f 100644 --- a/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredMessage.java +++ b/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredMessage.java @@ -18,25 +18,31 @@ package org.apache.activemq.store.jpa.model; import javax.persistence.Basic; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.Lob; + +import org.apache.openjpa.persistence.jdbc.Index; /** */ -@Entity +@Entity() public class StoredMessage { @Id private long id; - @Basic + @Basic(optional=false) + @Index(enabled=true, unique=false) private String messageId; - @Basic + @Basic(optional=false) + @Index(enabled=true, unique=false) private String destination; @Basic private long exiration; @Basic + @Lob private byte[] data; public StoredMessage() { diff --git a/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredSubscription.java b/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredSubscription.java index ca26d390ec..c99c7596e8 100644 --- a/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredSubscription.java +++ b/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/model/StoredSubscription.java @@ -21,6 +21,8 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import org.apache.openjpa.persistence.jdbc.Index; + /** */ @Entity @@ -91,10 +93,13 @@ public class StoredSubscription { private long id; @Basic + @Index(enabled=true, unique=false) private String destination; @Basic + @Index(enabled=true, unique=false) private String clientId; @Basic + @Index(enabled=true, unique=false) private String subscriptionName; @Basic