1 18 package org.apache.activemq.store.jdbc.adapter; 19 20 import org.apache.activemq.store.jdbc.Statements; 21 22 32 public class AxionJDBCAdapter extends StreamJDBCAdapter { 33 34 public void setStatements(Statements statements) { 35 36 statements.setCreateSchemaStatements( 37 new String []{ 38 "CREATE TABLE "+statements.getFullMessageTableName()+"(" 39 +"ID "+statements.getSequenceDataType()+" NOT NULL" 40 +", CONTAINER "+statements.getContainerNameDataType() 41 +", MSGID_PROD "+statements.getMsgIdDataType() 42 +", MSGID_SEQ "+statements.getSequenceDataType() 43 +", EXPIRATION "+statements.getLongDataType() 44 +", MSG "+(statements.isUseExternalMessageReferences() ? statements.getStringIdDataType() : statements.getBinaryDataType()) 45 +", PRIMARY KEY ( ID ) )", 46 "CREATE INDEX "+statements.getFullMessageTableName()+"_MIDX ON "+statements.getFullMessageTableName()+" (MSGID_PROD,MSGID_SEQ)", 47 "CREATE INDEX "+statements.getFullMessageTableName()+"_CIDX ON "+statements.getFullMessageTableName()+" (CONTAINER)", 48 "CREATE INDEX "+statements.getFullMessageTableName()+"_EIDX ON "+statements.getFullMessageTableName()+" (EXPIRATION)", 49 "CREATE TABLE "+statements.getFullAckTableName()+"(" 50 +"CONTAINER "+statements.getContainerNameDataType()+" NOT NULL" 51 +", CLIENT_ID "+statements.getStringIdDataType()+" NOT NULL" 52 +", SUB_NAME "+statements.getStringIdDataType()+" NOT NULL" 53 +", SELECTOR "+statements.getStringIdDataType() 54 +", LAST_ACKED_ID "+statements.getSequenceDataType() 55 +", PRIMARY KEY ( CONTAINER, CLIENT_ID, SUB_NAME))", 56 } 57 ); 58 statements.setDeleteOldMessagesStatement("DELETE FROM "+statements.getFullMessageTableName()+ " WHERE ( EXPIRATION<>0 AND EXPIRATION<?)"); 59 statements.setLongDataType("LONG"); 60 61 super.setStatements(statements); 62 } 63 64 } 65 | Popular Tags |