[jboss-svn-commits] JBoss Common SVN: r2513 - in jbossxb-builder/trunk/src/test: java/org/jboss/ejb/metadata/jboss/cmp and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Aug 24 18:06:58 EDT 2007
Author: alex.loubyansky at jboss.com
Date: 2007-08-24 18:06:58 -0400 (Fri, 24 Aug 2007)
New Revision: 2513
Added:
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPAuditMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPCMPFieldMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDeclaredSqlMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDefaultsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDependentValueClassesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationshipRole.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEnterpriseBeansMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityBeanMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPKeyFieldMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLeftJoinMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLoadGroupMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPOptimisticLockingMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPreferredRelationMapping.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPropertyMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMethodMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPReadAheadMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationTableMapping.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationshipsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPTypeMappingMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUnknownPkMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUserTypeMappingMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JDBCTypeAdapter.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/JBossCMPUnitTestCase.java
jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testDefaults.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testEntityCommands.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testReservedWords.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testTypeMappings.xml
Modified:
jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/EJBMetaDataTestSuite.java
Log:
adding jbosscmp
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPAuditMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPAuditMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPAuditMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+
+/**
+ * A JBossCMPAuditMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPAuditMetaData
+{
+ private Field createdBy;
+ private Field createdTime;
+ private Field updatedBy;
+ private Field updatedTimed;
+
+ public static class Field
+ {
+ private String fieldName;
+ private String columnName;
+ private int jdbcType;
+ private String sqlType;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPCMPFieldMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPCMPFieldMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPCMPFieldMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A JBossCMPCMPFieldMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPCMPFieldMetaData
+{
+ private String fieldName;
+ private boolean readOnly;
+ private long readTimeOut;
+ private String columnName;
+ private boolean notNull;
+ private int jdbcType;
+ private String sqlType;
+ private List<JBossCMPPropertyMetaData> properties;
+ private boolean autoIncrement;
+ private boolean dbIndex;
+ private boolean checkDirtyAfterGet;
+ private String stateFactory;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDeclaredSqlMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDeclaredSqlMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDeclaredSqlMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+
+/**
+ * A JBossCMPDeclaredSqlMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPDeclaredSqlMetaData
+{
+ private Select select;
+ private String from;
+ private String where;
+ private String order;
+ private String other;
+
+ public static class Select
+ {
+ private boolean distinct;
+ private String ejbName;
+ private String fieldName;
+ private String alias;
+ private String additionalColumns;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDefaultsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDefaultsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDefaultsMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,258 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * A DefaultsMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="defaultsType")
+public class JBossCMPDefaultsMetaData
+{
+ private String datasource;
+ private String datasourceMapping;
+ private boolean createTable;
+ private boolean alterTable;
+ private boolean removeTable;
+ private List<String> postTableCreate;
+ private boolean readOnly;
+ private long readTimeOut;
+ private boolean rowLocking;
+ private boolean pkConstraint;
+ private boolean fkConstraint;
+ private JBossCMPPreferredRelationMapping preferredRelationMapping;
+ private JBossCMPReadAheadMetaData readAhead;
+ private long listCacheMax;
+ private boolean cleanReadAheadOnLoad;
+ private long fetchSize;
+ private JBossCMPUnknownPkMetaData unknownPk;
+ private JBossCMPEntityCommandMetaData entityCommand;
+ private String qlCompiler;
+ private boolean throwRuntimeExceptions;
+
+ public boolean isAlterTable()
+ {
+ return alterTable;
+ }
+
+ public void setAlterTable(boolean alterTable)
+ {
+ this.alterTable = alterTable;
+ }
+
+ public boolean isCleanReadAheadOnLoad()
+ {
+ return cleanReadAheadOnLoad;
+ }
+
+ public void setCleanReadAheadOnLoad(boolean cleanReadAheadOnLoad)
+ {
+ this.cleanReadAheadOnLoad = cleanReadAheadOnLoad;
+ }
+
+ public boolean isCreateTable()
+ {
+ return createTable;
+ }
+
+ public void setCreateTable(boolean createTable)
+ {
+ this.createTable = createTable;
+ }
+
+ public String getDatasource()
+ {
+ return datasource;
+ }
+
+ public void setDatasource(String datasource)
+ {
+ this.datasource = datasource;
+ }
+
+ public String getDatasourceMapping()
+ {
+ return datasourceMapping;
+ }
+
+ public void setDatasourceMapping(String datasourceMapping)
+ {
+ this.datasourceMapping = datasourceMapping;
+ }
+
+ public JBossCMPEntityCommandMetaData getEntityCommand()
+ {
+ return entityCommand;
+ }
+
+ public void setEntityCommand(JBossCMPEntityCommandMetaData entityCommand)
+ {
+ this.entityCommand = entityCommand;
+ }
+
+ public long getFetchSize()
+ {
+ return fetchSize;
+ }
+
+ public void setFetchSize(long fetchSize)
+ {
+ this.fetchSize = fetchSize;
+ }
+
+ public boolean isFkConstraint()
+ {
+ return fkConstraint;
+ }
+
+ public void setFkConstraint(boolean fkConstraint)
+ {
+ this.fkConstraint = fkConstraint;
+ }
+
+ public long getListCacheMax()
+ {
+ return listCacheMax;
+ }
+
+ public void setListCacheMax(long listCacheMax)
+ {
+ this.listCacheMax = listCacheMax;
+ }
+
+ public boolean isPkConstraint()
+ {
+ return pkConstraint;
+ }
+
+ public void setPkConstraint(boolean pkConstraint)
+ {
+ this.pkConstraint = pkConstraint;
+ }
+
+ public List<String> getPostTableCreate()
+ {
+ return postTableCreate;
+ }
+
+ public void setPostTableCreate(List<String> postTableCreate)
+ {
+ this.postTableCreate = postTableCreate;
+ }
+
+ public JBossCMPPreferredRelationMapping getPreferredRelationMapping()
+ {
+ return preferredRelationMapping;
+ }
+
+ public void setPreferredRelationMapping(JBossCMPPreferredRelationMapping preferredRelationMapping)
+ {
+ this.preferredRelationMapping = preferredRelationMapping;
+ }
+
+ public String getQlCompiler()
+ {
+ return qlCompiler;
+ }
+
+ public void setQlCompiler(String qlCompiler)
+ {
+ this.qlCompiler = qlCompiler;
+ }
+
+ public JBossCMPReadAheadMetaData getReadAhead()
+ {
+ return readAhead;
+ }
+
+ public void setReadAhead(JBossCMPReadAheadMetaData readAhead)
+ {
+ this.readAhead = readAhead;
+ }
+
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ public long getReadTimeOut()
+ {
+ return readTimeOut;
+ }
+
+ public void setReadTimeOut(long readTimeOut)
+ {
+ this.readTimeOut = readTimeOut;
+ }
+
+ public boolean isRemoveTable()
+ {
+ return removeTable;
+ }
+
+ public void setRemoveTable(boolean removeTable)
+ {
+ this.removeTable = removeTable;
+ }
+
+ public boolean isRowLocking()
+ {
+ return rowLocking;
+ }
+
+ public void setRowLocking(boolean rowLocking)
+ {
+ this.rowLocking = rowLocking;
+ }
+
+ public boolean isThrowRuntimeExceptions()
+ {
+ return throwRuntimeExceptions;
+ }
+
+ public void setThrowRuntimeExceptions(boolean throwRuntimeExceptions)
+ {
+ this.throwRuntimeExceptions = throwRuntimeExceptions;
+ }
+
+ public JBossCMPUnknownPkMetaData getUnknownPk()
+ {
+ return unknownPk;
+ }
+
+ public void setUnknownPk(JBossCMPUnknownPkMetaData unknownPk)
+ {
+ this.unknownPk = unknownPk;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDependentValueClassesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDependentValueClassesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPDependentValueClassesMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+
+/**
+ * A JBossCMPDependentValueClassesMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPDependentValueClassesMetaData
+{
+
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import org.jboss.ejb.metadata.spec.RelationMetaData;
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptionGroupWithOverride;
+
+
+/**
+ * A JBossCMPEjbRelationMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPEjbRelationMetaData
+ extends NamedMetaDataWithDescriptionGroupWithOverride<RelationMetaData>
+{
+ private String ejbRelationName;
+ private boolean readOnly;
+ private long readTimeOut;
+ private boolean foreignKeyMapping;
+ private JBossCMPRelationTableMapping relationTableMapping;
+ private JBossCMPEjbRelationshipRole leftRole;
+ private JBossCMPEjbRelationshipRole rightRole;
+
+ public String getEjbRelationName()
+ {
+ return ejbRelationName;
+ }
+ public void setEjbRelationName(String ejbRelationName)
+ {
+ this.ejbRelationName = ejbRelationName;
+ }
+ public boolean isForeignKeyMapping()
+ {
+ return foreignKeyMapping;
+ }
+ public void setForeignKeyMapping(boolean foreignKeyMapping)
+ {
+ this.foreignKeyMapping = foreignKeyMapping;
+ }
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+ public long getReadTimeOut()
+ {
+ return readTimeOut;
+ }
+ public void setReadTimeOut(long readTimeOut)
+ {
+ this.readTimeOut = readTimeOut;
+ }
+ public JBossCMPRelationTableMapping getRelationTableMapping()
+ {
+ return relationTableMapping;
+ }
+ public void setRelationTableMapping(JBossCMPRelationTableMapping relationTableMapping)
+ {
+ this.relationTableMapping = relationTableMapping;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationshipRole.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationshipRole.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEjbRelationshipRole.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A JBossCMPEjbRelationshipRole.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPEjbRelationshipRole
+{
+ private String ejbRelationshipRoleName;
+ private boolean fkConstraint;
+ private List<JBossCMPKeyFieldMetaData> keyFields;
+ private JBossCMPReadAheadMetaData readAhead;
+ private boolean batchCascadeDelete;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEnterpriseBeansMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEnterpriseBeansMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEnterpriseBeansMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import org.jboss.ejb.metadata.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.ejb.metadata.jboss.JBossEntityBeanMetaData;
+import org.jboss.ejb.metadata.jboss.JBossMessageDrivenBeanMetaData;
+import org.jboss.ejb.metadata.jboss.JBossSessionBeanMetaData;
+import org.jboss.ejb.metadata.spec.EnterpriseBeanMetaData;
+import org.jboss.ejb.metadata.spec.EnterpriseBeansMetaData;
+import org.jboss.ejb.metadata.spec.EntityBeanMetaData;
+import org.jboss.ejb.metadata.spec.MessageDrivenBeanMetaData;
+import org.jboss.ejb.metadata.spec.SessionBeanMetaData;
+import org.jboss.javaee.metadata.support.AbstractMappedMetaDataWithOverride;
+
+
+/**
+ * A JBossCMPEnterpriseBeansMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPEnterpriseBeansMetaData extends AbstractMappedMetaDataWithOverride<EnterpriseBeanMetaData, JBossCMPEntityBeanMetaData, EnterpriseBeansMetaData>
+{
+ protected JBossCMPEnterpriseBeansMetaData()
+ {
+ super("ejb name for enterprise bean");
+ }
+
+ public JBossCMPEntityBeanMetaData createOverride(EnterpriseBeanMetaData data)
+ {
+ if (data == null)
+ throw new IllegalArgumentException("Null data");
+ if (!(data instanceof EntityBeanMetaData))
+ throw new IllegalArgumentException("Unregonised: " + data);
+
+ JBossCMPEntityBeanMetaData result = new JBossCMPEntityBeanMetaData();
+
+ result.setEjbName(data.getEjbName());
+ result.setOverridenMetaData(data);
+ return result;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityBeanMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityBeanMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityBeanMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,276 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.jboss.ejb.metadata.spec.EnterpriseBeanMetaData;
+import org.jboss.ejb.metadata.spec.EntityBeanMetaData;
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptionGroupWithOverride;
+
+
+/**
+ * A JBossCMPEntityBeanMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPEntityBeanMetaData extends NamedMetaDataWithDescriptionGroupWithOverride<EnterpriseBeanMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -4847975458333924853L;
+
+ private String ejbName;
+
+ private String datasource;
+ private String datasourceMapping;
+ private boolean createTable;
+ private boolean removeTable;
+ private List<String> postTableCreate;
+ private boolean readOnly;
+ private long readTimeOut;
+ private boolean rowLocking;
+ private boolean pkConstraint;
+ private JBossCMPReadAheadMetaData readAhead;
+ private long listCacheMax;
+ private boolean cleanReadAheadOnLoad;
+ private long fetchSize;
+ private String tableName;
+ private List<JBossCMPCMPFieldMetaData> cmpFields;
+ private List<JBossCMPLoadGroupMetaData> loadGroups;
+ private String eagerLoadGroup;
+ private List<String> lazyLoadGroups;
+ private List<JBossCMPQueryMetaData> queries;
+ private JBossCMPUnknownPkMetaData unknownPk;
+ private JBossCMPEntityCommandMetaData entityCommand;
+ private JBossCMPOptimisticLockingMetaData optimisticLocking;
+ private JBossCMPAuditMetaData audit;
+
+ @Override
+ public EntityBeanMetaData getOverridenMetaData()
+ {
+ return (EntityBeanMetaData) super.getOverridenMetaData();
+ }
+
+ @XmlTransient
+ public void setOverridenMetaData(EntityBeanMetaData data)
+ {
+ super.setOverridenMetaData(data);
+ }
+
+ public JBossCMPAuditMetaData getAudit()
+ {
+ return audit;
+ }
+ public void setAudit(JBossCMPAuditMetaData audit)
+ {
+ this.audit = audit;
+ }
+ public boolean isCleanReadAheadOnLoad()
+ {
+ return cleanReadAheadOnLoad;
+ }
+ public void setCleanReadAheadOnLoad(boolean cleanReadAheadOnLoad)
+ {
+ this.cleanReadAheadOnLoad = cleanReadAheadOnLoad;
+ }
+ public List<JBossCMPCMPFieldMetaData> getCmpFields()
+ {
+ return cmpFields;
+ }
+ public void setCmpFields(List<JBossCMPCMPFieldMetaData> cmpFields)
+ {
+ this.cmpFields = cmpFields;
+ }
+ public boolean isCreateTable()
+ {
+ return createTable;
+ }
+ public void setCreateTable(boolean createTable)
+ {
+ this.createTable = createTable;
+ }
+ public String getDatasource()
+ {
+ return datasource;
+ }
+ public void setDatasource(String datasource)
+ {
+ this.datasource = datasource;
+ }
+ public String getDatasourceMapping()
+ {
+ return datasourceMapping;
+ }
+ public void setDatasourceMapping(String datasourceMapping)
+ {
+ this.datasourceMapping = datasourceMapping;
+ }
+ public String getEagerLoadGroup()
+ {
+ return eagerLoadGroup;
+ }
+ public void setEagerLoadGroup(String eagerLoadGroup)
+ {
+ this.eagerLoadGroup = eagerLoadGroup;
+ }
+ public String getEjbName()
+ {
+ return ejbName;
+ }
+ public void setEjbName(String ejbName)
+ {
+ this.ejbName = ejbName;
+ }
+ public JBossCMPEntityCommandMetaData getEntityCommand()
+ {
+ return entityCommand;
+ }
+ public void setEntityCommand(JBossCMPEntityCommandMetaData entityCommand)
+ {
+ this.entityCommand = entityCommand;
+ }
+ public long getFetchSize()
+ {
+ return fetchSize;
+ }
+ public void setFetchSize(long fetchSize)
+ {
+ this.fetchSize = fetchSize;
+ }
+ public List<String> getLazyLoadGroups()
+ {
+ return lazyLoadGroups;
+ }
+ public void setLazyLoadGroups(List<String> lazyLoadGroups)
+ {
+ this.lazyLoadGroups = lazyLoadGroups;
+ }
+ public long getListCacheMax()
+ {
+ return listCacheMax;
+ }
+ public void setListCacheMax(long listCacheMax)
+ {
+ this.listCacheMax = listCacheMax;
+ }
+ public List<JBossCMPLoadGroupMetaData> getLoadGroups()
+ {
+ return loadGroups;
+ }
+ public void setLoadGroups(List<JBossCMPLoadGroupMetaData> loadGroups)
+ {
+ this.loadGroups = loadGroups;
+ }
+ public JBossCMPOptimisticLockingMetaData getOptimisticLocking()
+ {
+ return optimisticLocking;
+ }
+ public void setOptimisticLocking(JBossCMPOptimisticLockingMetaData optimisticLocking)
+ {
+ this.optimisticLocking = optimisticLocking;
+ }
+ public boolean isPkConstraint()
+ {
+ return pkConstraint;
+ }
+ public void setPkConstraint(boolean pkConstraint)
+ {
+ this.pkConstraint = pkConstraint;
+ }
+ public List<String> getPostTableCreate()
+ {
+ return postTableCreate;
+ }
+ public void setPostTableCreate(List<String> postTableCreate)
+ {
+ this.postTableCreate = postTableCreate;
+ }
+ public List<JBossCMPQueryMetaData> getQueries()
+ {
+ return queries;
+ }
+ public void setQueries(List<JBossCMPQueryMetaData> queries)
+ {
+ this.queries = queries;
+ }
+ public JBossCMPReadAheadMetaData getReadAhead()
+ {
+ return readAhead;
+ }
+ public void setReadAhead(JBossCMPReadAheadMetaData readAhead)
+ {
+ this.readAhead = readAhead;
+ }
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+ public long getReadTimeOut()
+ {
+ return readTimeOut;
+ }
+ public void setReadTimeOut(long readTimeOut)
+ {
+ this.readTimeOut = readTimeOut;
+ }
+ public boolean isRemoveTable()
+ {
+ return removeTable;
+ }
+ public void setRemoveTable(boolean removeTable)
+ {
+ this.removeTable = removeTable;
+ }
+ public boolean isRowLocking()
+ {
+ return rowLocking;
+ }
+ public void setRowLocking(boolean rowLocking)
+ {
+ this.rowLocking = rowLocking;
+ }
+ public String getTableName()
+ {
+ return tableName;
+ }
+ public void setTableName(String tableName)
+ {
+ this.tableName = tableName;
+ }
+ public JBossCMPUnknownPkMetaData getUnknownPk()
+ {
+ return unknownPk;
+ }
+ public void setUnknownPk(JBossCMPUnknownPkMetaData unknownPk)
+ {
+ this.unknownPk = unknownPk;
+ }
+
+
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.AbstractCollection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+import org.jboss.xb.annotations.JBossXmlChild;
+
+
+/**
+ * A EntityCommandMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="entity-commandType")
+ at JBossXmlChild(name="attribute", type=JBossCMPEntityCommandMetaData.Attribute.class, unbounded=true)
+public class JBossCMPEntityCommandMetaData extends AbstractCollection<JBossCMPEntityCommandMetaData.Attribute>
+{
+ private String name;
+ private String className;
+ private Map<String, Attribute> attributes = Collections.EMPTY_MAP;
+
+
+ /**
+ * Get the className.
+ *
+ * @return the className.
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Set the className.
+ *
+ * @param className The className to set.
+ */
+ @XmlAttribute(name="class")
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ *
+ * @param name The name to set.
+ */
+ @XmlAttribute
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlTransient
+ public String getAttribute(String name)
+ {
+ Attribute attr = attributes.get(name);
+ return attr == null ? null : attr.getValue();
+ }
+
+ public boolean hasAttributes()
+ {
+ return !attributes.isEmpty();
+ }
+
+ @Override
+ public boolean add(JBossCMPEntityCommandMetaData.Attribute attribute)
+ {
+ if(attributes.isEmpty())
+ {
+ attributes = Collections.singletonMap(attribute.getName(), attribute);
+ return true;
+ }
+
+ if(attributes.size() == 1)
+ {
+ attributes = new HashMap<String, Attribute>(attributes);
+ }
+ return attributes.put(attribute.name, attribute) == null;
+ }
+
+ @Override
+ public Iterator<JBossCMPEntityCommandMetaData.Attribute> iterator()
+ {
+ return attributes.values().iterator();
+ }
+
+ @Override
+ public int size()
+ {
+ return attributes.size();
+ }
+
+ public static class Attribute
+ {
+ private String name;
+ private String value;
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ *
+ * @param name The name to set.
+ */
+ @XmlAttribute
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the value.
+ *
+ * @return the value.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Set the value.
+ *
+ * @param value The value to set.
+ */
+ @XmlValue
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPKeyFieldMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPKeyFieldMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPKeyFieldMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A JBossCMPKeyFieldMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPKeyFieldMetaData
+{
+ private String fieldName;
+ private String columnName;
+ private int jdbcType;
+ private String sqlType;
+ private List<JBossCMPPropertyMetaData> properties;
+ private boolean dbIndex;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLeftJoinMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLeftJoinMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLeftJoinMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A JBossCMPLeftJoinMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPLeftJoinMetaData
+{
+ private String cmrField;
+ private String eagerLoadGroup;
+ private List<JBossCMPLeftJoinMetaData> leftJoins;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLoadGroupMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLoadGroupMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPLoadGroupMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A JBossCMPLoadGroupMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPLoadGroupMetaData
+{
+ private String description;
+ private String loadGroupName;
+ private List<String> fieldNames;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,249 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.ejb.metadata.jboss.JBossMetaData;
+import org.jboss.ejb.metadata.spec.EjbJarMetaData;
+import org.jboss.javaee.metadata.spec.JavaEEMetaDataConstants;
+import org.jboss.javaee.metadata.support.IdMetaDataImplWithDescriptionGroupWithOverride;
+import org.jboss.logging.Logger;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+
+/**
+ * A JBossCMPJDBCMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlRootElement(name="jbosscmp-jdbc", namespace=JavaEEMetaDataConstants.JBOSS_CMP2X_NS)
+ at JBossXmlSchema(
+ xmlns={@XmlNs(namespaceURI = JavaEEMetaDataConstants.JAVAEE_NS, prefix = "jee")},
+ ignoreUnresolvedFieldOrClass=false,
+ namespace=JavaEEMetaDataConstants.JBOSS_CMP2X_NS,
+ elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlType(name="jbosscmp-jdbcType", namespace=JavaEEMetaDataConstants.JBOSS_CMP2X_NS)
+public class JBossCMPMetaData extends IdMetaDataImplWithDescriptionGroupWithOverride<EjbJarMetaData>
+{
+ /** The log */
+ private static final Logger log = Logger.getLogger(JBossMetaData.class);
+
+ private JBossCMPDefaultsMetaData defaults;
+ private JBossCMPEnterpriseBeansMetaData enterpriseBeans;
+ private JBossCMPRelationshipsMetaData relationships;
+ private JBossCMPDependentValueClassesMetaData dependentValueClasses;
+ private List<JBossCMPTypeMappingMetaData> typeMappings;
+ private List<JBossCMPEntityCommandMetaData> entityCommands;
+ private List<JBossCMPUserTypeMappingMetaData> userTypeMappings;
+ private List<String> reservedWords;
+
+ public JBossCMPMetaData()
+ {
+ // for serialization
+ }
+
+ /**
+ * Get the defaults.
+ *
+ * @return the defaults.
+ */
+
+ public JBossCMPDefaultsMetaData getDefaults()
+ {
+ return defaults;
+ }
+
+ /**
+ * Set the defaults.
+ *
+ * @param defaults The defaults to set.
+ */
+
+ public void setDefaults(JBossCMPDefaultsMetaData defaults)
+ {
+ this.defaults = defaults;
+ }
+
+ /**
+ * Get the dependentValueClasses.
+ *
+ * @return the dependentValueClasses.
+ */
+
+ public JBossCMPDependentValueClassesMetaData getDependentValueClasses()
+ {
+ return dependentValueClasses;
+ }
+
+ /**
+ * Set the dependentValueClasses.
+ *
+ * @param dependentValueClasses The dependentValueClasses to set.
+ */
+
+ public void setDependentValueClasses(JBossCMPDependentValueClassesMetaData dependentValueClasses)
+ {
+ this.dependentValueClasses = dependentValueClasses;
+ }
+
+ /**
+ * Get the enterpriseBeans.
+ *
+ * @return the enterpriseBeans.
+ */
+
+ public JBossCMPEnterpriseBeansMetaData getEnterpriseBeans()
+ {
+ return enterpriseBeans;
+ }
+
+ /**
+ * Set the enterpriseBeans.
+ *
+ * @param enterpriseBeans The enterpriseBeans to set.
+ */
+
+ public void setEnterpriseBeans(JBossCMPEnterpriseBeansMetaData enterpriseBeans)
+ {
+ this.enterpriseBeans = enterpriseBeans;
+ }
+
+ /**
+ * Get the entityCommands.
+ *
+ * @return the entityCommands.
+ */
+ public List<JBossCMPEntityCommandMetaData> getEntityCommands()
+ {
+ return entityCommands;
+ }
+
+ /**
+ * Set the entityCommands.
+ *
+ * @param entityCommands The entityCommands to set.
+ */
+ @XmlElementWrapper
+ @XmlElement(name="entity-command")
+ public void setEntityCommands(List<JBossCMPEntityCommandMetaData> entityCommands)
+ {
+ this.entityCommands = entityCommands;
+ }
+
+ /**
+ * Get the relationships.
+ *
+ * @return the relationships.
+ */
+
+ public JBossCMPRelationshipsMetaData getRelationships()
+ {
+ return relationships;
+ }
+
+ /**
+ * Set the relationships.
+ *
+ * @param relationships The relationships to set.
+ */
+
+ public void setRelationships(JBossCMPRelationshipsMetaData relationships)
+ {
+ this.relationships = relationships;
+ }
+
+ /**
+ * Get the reservedWords.
+ *
+ * @return the reservedWords.
+ */
+ public List<String> getReservedWords()
+ {
+ return reservedWords;
+ }
+
+ /**
+ * Set the reservedWords.
+ *
+ * @param reservedWords The reservedWords to set.
+ */
+ @XmlElementWrapper
+ @XmlElement(name="word")
+ public void setReservedWords(List<String> reservedWords)
+ {
+ this.reservedWords = reservedWords;
+ }
+
+ /**
+ * Get the typeMappings.
+ *
+ * @return the typeMappings.
+ */
+
+ public List<JBossCMPTypeMappingMetaData> getTypeMappings()
+ {
+ return typeMappings;
+ }
+
+ /**
+ * Set the typeMappings.
+ *
+ * @param typeMappings The typeMappings to set.
+ */
+ @XmlElementWrapper
+ @XmlElement(name="type-mapping")
+ public void setTypeMappings(List<JBossCMPTypeMappingMetaData> typeMappings)
+ {
+ this.typeMappings = typeMappings;
+ }
+
+ /**
+ * Get the userTypeMappings.
+ *
+ * @return the userTypeMappings.
+ */
+
+ public List<JBossCMPUserTypeMappingMetaData> getUserTypeMappings()
+ {
+ return userTypeMappings;
+ }
+
+ /**
+ * Set the userTypeMappings.
+ *
+ * @param userTypeMappings The userTypeMappings to set.
+ */
+
+ public void setUserTypeMappings(List<JBossCMPUserTypeMappingMetaData> userTypeMappings)
+ {
+ this.userTypeMappings = userTypeMappings;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPOptimisticLockingMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPOptimisticLockingMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPOptimisticLockingMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+
+/**
+ * A JBossCMPOptimisticLockingMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPOptimisticLockingMetaData
+{
+ private String groupName;
+ private boolean modifiedStrategy;
+ private boolean readStrategy;
+ private String versionColumn;
+ private String timestampColumn;
+ private String keyGeneratorFactory;
+ private String fieldType;
+ private String fieldName;
+ private String columnName;
+ private int jdbcType;
+ private String sqlType;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPreferredRelationMapping.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPreferredRelationMapping.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPreferredRelationMapping.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+
+
+/**
+ * A PreferredRelationMappingMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlEnum
+public enum JBossCMPPreferredRelationMapping
+{
+ @XmlEnumValue("foreign-key")
+ ForeignKey,
+
+ @XmlEnumValue("relation-table")
+ RelationTable
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPropertyMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPropertyMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPPropertyMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+public class JBossCMPPropertyMetaData
+{
+ private String propertyName;
+ private String columnName;
+ private boolean notNull;
+ private int jdbcType;
+ private String sqlType;
+}
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+
+/**
+ * A JBossCMPQueryMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPQueryMetaData
+{
+ private String description;
+ private JBossCMPQueryMethodMetaData queryMethod;
+ private String jbossQl;
+ private boolean dynamicQl;
+ private JBossCMPDeclaredSqlMetaData declaredSql;
+ private JBossCMPReadAheadMetaData readAhead;
+ private String qlCompiler;
+ private boolean lazyResultsetLoading;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMethodMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMethodMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPQueryMethodMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A JBossCMPQueryMethodMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPQueryMethodMetaData
+{
+ private String methodName;
+ private List<String> methodParams;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPReadAheadMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPReadAheadMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPReadAheadMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A ReadAheadMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPReadAheadMetaData
+{
+ private String strategy;
+ private long pageSize;
+ private String eagerLoadGroup;
+ private List<JBossCMPLeftJoinMetaData> leftJoins;
+
+ /**
+ * Get the eagerLoadGroup.
+ *
+ * @return the eagerLoadGroup.
+ */
+
+ public String getEagerLoadGroup()
+ {
+ return eagerLoadGroup;
+ }
+ /**
+ * Set the eagerLoadGroup.
+ *
+ * @param eagerLoadGroup The eagerLoadGroup to set.
+ */
+
+ public void setEagerLoadGroup(String eagerLoadGroup)
+ {
+ this.eagerLoadGroup = eagerLoadGroup;
+ }
+ /**
+ * Get the leftJoins.
+ *
+ * @return the leftJoins.
+ */
+
+ public List<JBossCMPLeftJoinMetaData> getLeftJoins()
+ {
+ return leftJoins;
+ }
+ /**
+ * Set the leftJoins.
+ *
+ * @param leftJoins The leftJoins to set.
+ */
+
+ public void setLeftJoins(List<JBossCMPLeftJoinMetaData> leftJoins)
+ {
+ this.leftJoins = leftJoins;
+ }
+ /**
+ * Get the pageSize.
+ *
+ * @return the pageSize.
+ */
+
+ public long getPageSize()
+ {
+ return pageSize;
+ }
+ /**
+ * Set the pageSize.
+ *
+ * @param pageSize The pageSize to set.
+ */
+
+ public void setPageSize(long pageSize)
+ {
+ this.pageSize = pageSize;
+ }
+ /**
+ * Get the strategy.
+ *
+ * @return the strategy.
+ */
+
+ public String getStrategy()
+ {
+ return strategy;
+ }
+ /**
+ * Set the strategy.
+ *
+ * @param strategy The strategy to set.
+ */
+
+ public void setStrategy(String strategy)
+ {
+ this.strategy = strategy;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationTableMapping.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationTableMapping.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationTableMapping.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.util.List;
+
+
+/**
+ * A JBossCMPRelationTableMapping.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPRelationTableMapping
+{
+ private String tableName;
+ private String datasource;
+ private String datasourceMapping;
+ private boolean createTable;
+ private boolean removeTable;
+ private List<String> postTableCreate;
+ private boolean rowLocking;
+ private boolean pkConstraint;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationshipsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationshipsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPRelationshipsMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import org.jboss.ejb.metadata.spec.RelationMetaData;
+import org.jboss.ejb.metadata.spec.RelationsMetaData;
+import org.jboss.javaee.metadata.support.AbstractMappedMetaDataWithOverride;
+
+
+/**
+ * A JBossCMPRelationshipsMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPRelationshipsMetaData
+ extends AbstractMappedMetaDataWithOverride<RelationMetaData, JBossCMPEjbRelationMetaData, RelationsMetaData>
+{
+
+ protected JBossCMPRelationshipsMetaData()
+ {
+ super("ejb name for enterprise bean");
+ }
+
+ public JBossCMPEjbRelationMetaData createOverride(RelationMetaData data)
+ {
+ if (data == null)
+ throw new IllegalArgumentException("Null data");
+
+ JBossCMPEjbRelationMetaData result = new JBossCMPEjbRelationMetaData();
+ result.setEjbRelationName(data.getEjbRelationName());
+ result.setOverridenMetaData(data);
+ return result;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPTypeMappingMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPTypeMappingMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPTypeMappingMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,640 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+import org.jboss.javaee.metadata.support.MappableMetaData;
+
+
+/**
+ * A JBossCMPTypeMappingsMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="type-mappingType")
+public class JBossCMPTypeMappingMetaData
+{
+ private String name;
+ private String rowLockingTemplate;
+ private String pkConstraintTemplate;
+ private String fkConstraintTemplate;
+ private String autoIncrementTemplate;
+ private String addColumnTemplate;
+ private String alterColumnTemplate;
+ private String dropColumnTemplate;
+ private String aliasHeaderPrefix;
+ private String aliasHeaderSuffix;
+ private int aliasMaxLength;
+ private boolean subquerySupported;
+ private String trueMapping;
+ private String falseMapping;
+ private long maxKeysInDelete;
+ private FunctionMappings functionMappings;
+ private Mappings mappings;
+
+ public JBossCMPTypeMappingMetaData()
+ {
+ }
+
+ /**
+ * Get the addColumnTemplate.
+ *
+ * @return the addColumnTemplate.
+ */
+
+ public String getAddColumnTemplate()
+ {
+ return addColumnTemplate;
+ }
+
+ /**
+ * Set the addColumnTemplate.
+ *
+ * @param addColumnTemplate The addColumnTemplate to set.
+ */
+
+ public void setAddColumnTemplate(String addColumnTemplate)
+ {
+ this.addColumnTemplate = addColumnTemplate;
+ }
+
+ /**
+ * Get the aliasHeaderPrefix.
+ *
+ * @return the aliasHeaderPrefix.
+ */
+
+ public String getAliasHeaderPrefix()
+ {
+ return aliasHeaderPrefix;
+ }
+
+ /**
+ * Set the aliasHeaderPrefix.
+ *
+ * @param aliasHeaderPrefix The aliasHeaderPrefix to set.
+ */
+
+ public void setAliasHeaderPrefix(String aliasHeaderPrefix)
+ {
+ this.aliasHeaderPrefix = aliasHeaderPrefix;
+ }
+
+ /**
+ * Get the aliasHeaderSuffix.
+ *
+ * @return the aliasHeaderSuffix.
+ */
+
+ public String getAliasHeaderSuffix()
+ {
+ return aliasHeaderSuffix;
+ }
+
+ /**
+ * Set the aliasHeaderSuffix.
+ *
+ * @param aliasHeaderSuffix The aliasHeaderSuffix to set.
+ */
+
+ public void setAliasHeaderSuffix(String aliasHeaderSuffix)
+ {
+ this.aliasHeaderSuffix = aliasHeaderSuffix;
+ }
+
+ /**
+ * Get the aliasMaxLength.
+ *
+ * @return the aliasMaxLength.
+ */
+
+ public int getAliasMaxLength()
+ {
+ return aliasMaxLength;
+ }
+
+ /**
+ * Set the aliasMaxLength.
+ *
+ * @param aliasMaxLength The aliasMaxLength to set.
+ */
+
+ public void setAliasMaxLength(int aliasMaxLength)
+ {
+ this.aliasMaxLength = aliasMaxLength;
+ }
+
+ /**
+ * Get the alterColumnTemplate.
+ *
+ * @return the alterColumnTemplate.
+ */
+
+ public String getAlterColumnTemplate()
+ {
+ return alterColumnTemplate;
+ }
+
+ /**
+ * Set the alterColumnTemplate.
+ *
+ * @param alterColumnTemplate The alterColumnTemplate to set.
+ */
+
+ public void setAlterColumnTemplate(String alterColumnTemplate)
+ {
+ this.alterColumnTemplate = alterColumnTemplate;
+ }
+
+ /**
+ * Get the autoIncrementTemplate.
+ *
+ * @return the autoIncrementTemplate.
+ */
+
+ public String getAutoIncrementTemplate()
+ {
+ return autoIncrementTemplate;
+ }
+
+ /**
+ * Set the autoIncrementTemplate.
+ *
+ * @param autoIncrementTemplate The autoIncrementTemplate to set.
+ */
+
+ public void setAutoIncrementTemplate(String autoIncrementTemplate)
+ {
+ this.autoIncrementTemplate = autoIncrementTemplate;
+ }
+
+ /**
+ * Get the dropColumnTemplate.
+ *
+ * @return the dropColumnTemplate.
+ */
+
+ public String getDropColumnTemplate()
+ {
+ return dropColumnTemplate;
+ }
+
+ /**
+ * Set the dropColumnTemplate.
+ *
+ * @param dropColumnTemplate The dropColumnTemplate to set.
+ */
+
+ public void setDropColumnTemplate(String dropColumnTemplate)
+ {
+ this.dropColumnTemplate = dropColumnTemplate;
+ }
+
+ /**
+ * Get the falseMapping.
+ *
+ * @return the falseMapping.
+ */
+
+ public String getFalseMapping()
+ {
+ return falseMapping;
+ }
+
+ /**
+ * Set the falseMapping.
+ *
+ * @param falseMapping The falseMapping to set.
+ */
+
+ public void setFalseMapping(String falseMapping)
+ {
+ this.falseMapping = falseMapping;
+ }
+
+ /**
+ * Get the fkConstraintTemplate.
+ *
+ * @return the fkConstraintTemplate.
+ */
+
+ public String getFkConstraintTemplate()
+ {
+ return fkConstraintTemplate;
+ }
+
+ /**
+ * Set the fkConstraintTemplate.
+ *
+ * @param fkConstraintTemplate The fkConstraintTemplate to set.
+ */
+
+ public void setFkConstraintTemplate(String fkConstraintTemplate)
+ {
+ this.fkConstraintTemplate = fkConstraintTemplate;
+ }
+
+ /**
+ * Get the functionMappings.
+ *
+ * @return the functionMappings.
+ */
+ public FunctionMappings getFunctionMappings()
+ {
+ return functionMappings;
+ }
+
+ /**
+ * Set the functionMappings.
+ *
+ * @param functionMappings The functionMappings to set.
+ */
+ @XmlElement(name="function-mapping")
+ public void setFunctionMappings(FunctionMappings functionMappings)
+ {
+ this.functionMappings = functionMappings;
+ }
+
+ /**
+ * Get the mappings.
+ *
+ * @return the mappings.
+ */
+ public Mappings getMappings()
+ {
+ return mappings;
+ }
+
+ /**
+ * Set the mappings.
+ *
+ * @param mappings The mappings to set.
+ */
+ @XmlElement(name="mapping")
+ public void setMappings(Mappings mappings)
+ {
+ this.mappings = mappings;
+ }
+
+ /**
+ * Get the maxKeysInDelete.
+ *
+ * @return the maxKeysInDelete.
+ */
+
+ public long getMaxKeysInDelete()
+ {
+ return maxKeysInDelete;
+ }
+
+ /**
+ * Set the maxKeysInDelete.
+ *
+ * @param maxKeysInDelete The maxKeysInDelete to set.
+ */
+
+ public void setMaxKeysInDelete(long maxKeysInDelete)
+ {
+ this.maxKeysInDelete = maxKeysInDelete;
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ *
+ * @param name The name to set.
+ */
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the pkConstraintTemplate.
+ *
+ * @return the pkConstraintTemplate.
+ */
+
+ public String getPkConstraintTemplate()
+ {
+ return pkConstraintTemplate;
+ }
+
+ /**
+ * Set the pkConstraintTemplate.
+ *
+ * @param pkConstraintTemplate The pkConstraintTemplate to set.
+ */
+
+ public void setPkConstraintTemplate(String pkConstraintTemplate)
+ {
+ this.pkConstraintTemplate = pkConstraintTemplate;
+ }
+
+ /**
+ * Get the rowLockingTemplate.
+ *
+ * @return the rowLockingTemplate.
+ */
+
+ public String getRowLockingTemplate()
+ {
+ return rowLockingTemplate;
+ }
+
+ /**
+ * Set the rowLockingTemplate.
+ *
+ * @param rowLockingTemplate The rowLockingTemplate to set.
+ */
+
+ public void setRowLockingTemplate(String rowLockingTemplate)
+ {
+ this.rowLockingTemplate = rowLockingTemplate;
+ }
+
+ /**
+ * Get the subquerySupported.
+ *
+ * @return the subquerySupported.
+ */
+
+ public boolean isSubquerySupported()
+ {
+ return subquerySupported;
+ }
+
+ /**
+ * Set the subquerySupported.
+ *
+ * @param subquerySupported The subquerySupported to set.
+ */
+
+ public void setSubquerySupported(boolean subquerySupported)
+ {
+ this.subquerySupported = subquerySupported;
+ }
+
+ /**
+ * Get the trueMapping.
+ *
+ * @return the trueMapping.
+ */
+
+ public String getTrueMapping()
+ {
+ return trueMapping;
+ }
+
+ /**
+ * Set the trueMapping.
+ *
+ * @param trueMapping The trueMapping to set.
+ */
+
+ public void setTrueMapping(String trueMapping)
+ {
+ this.trueMapping = trueMapping;
+ }
+
+ @XmlTransient
+ public String getFunctionSql(String functionName)
+ {
+ FunctionMapping mapping = functionMappings.get(functionName);
+ return mapping == null ? null : mapping.getFunctionSql();
+ }
+
+ @XmlTransient
+ public int getJdbcType(String javaType)
+ {
+ Mapping mapping = mappings.get(javaType);
+ return mapping == null ? null : mapping.getJdbcType();
+ }
+
+ @XmlTransient
+ public String getSqlType(String javaType)
+ {
+ Mapping mapping = mappings.get(javaType);
+ return mapping == null ? null : mapping.getSqlType();
+ }
+
+ public static class FunctionMappings extends AbstractMappedMetaData<FunctionMapping>
+ {
+ public FunctionMappings()
+ {
+ super("function mappings");
+ }
+ }
+
+ public static class FunctionMapping implements MappableMetaData
+ {
+ private String functionName;
+ private String functionSql;
+
+ /**
+ * Get the functionName.
+ *
+ * @return the functionName.
+ */
+ public String getFunctionName()
+ {
+ return functionName;
+ }
+
+ /**
+ * Set the functionName.
+ *
+ * @param functionName The functionName to set.
+ */
+ public void setFunctionName(String functionName)
+ {
+ this.functionName = functionName;
+ }
+
+ /**
+ * Get the functionSql.
+ *
+ * @return the functionSql.
+ */
+ public String getFunctionSql()
+ {
+ return functionSql;
+ }
+
+ /**
+ * Set the functionSql.
+ *
+ * @param functionSql The functionSql to set.
+ */
+ public void setFunctionSql(String functionSql)
+ {
+ this.functionSql = functionSql;
+ }
+
+ public String getKey()
+ {
+ return functionName;
+ }
+ }
+
+ public static class Mappings extends AbstractMappedMetaData<Mapping>
+ {
+ public Mappings()
+ {
+ super("mapping");
+ }
+ }
+
+ public static class Mapping implements MappableMetaData
+ {
+ private String javaType;
+ private int jdbcType;
+ private String sqlType;
+ private String paramSetter;
+ private String resultReader;
+
+ /**
+ * Get the javaType.
+ *
+ * @return the javaType.
+ */
+
+ public String getJavaType()
+ {
+ return javaType;
+ }
+
+ /**
+ * Set the javaType.
+ *
+ * @param javaType The javaType to set.
+ */
+ public void setJavaType(String javaType)
+ {
+ this.javaType = javaType;
+ }
+
+ /**
+ * Get the jdbcType.
+ *
+ * @return the jdbcType.
+ */
+ public int getJdbcType()
+ {
+ return jdbcType;
+ }
+
+ /**
+ * Set the jdbcType.
+ *
+ * @param jdbcType The jdbcType to set.
+ */
+ @XmlJavaTypeAdapter(value=JDBCTypeAdapter.class)
+ public void setJdbcType(int jdbcType)
+ {
+ this.jdbcType = jdbcType;
+ }
+
+ /**
+ * Get the paramSetter.
+ *
+ * @return the paramSetter.
+ */
+ public String getParamSetter()
+ {
+ return paramSetter;
+ }
+
+ /**
+ * Set the paramSetter.
+ *
+ * @param paramSetter The paramSetter to set.
+ */
+ public void setParamSetter(String paramSetter)
+ {
+ this.paramSetter = paramSetter;
+ }
+
+ /**
+ * Get the resultReader.
+ *
+ * @return the resultReader.
+ */
+ public String getResultReader()
+ {
+ return resultReader;
+ }
+
+ /**
+ * Set the resultReader.
+ *
+ * @param resultReader The resultReader to set.
+ */
+ public void setResultReader(String resultReader)
+ {
+ this.resultReader = resultReader;
+ }
+
+ /**
+ * Get the sqlType.
+ *
+ * @return the sqlType.
+ */
+ public String getSqlType()
+ {
+ return sqlType;
+ }
+
+ /**
+ * Set the sqlType.
+ *
+ * @param sqlType The sqlType to set.
+ */
+ public void setSqlType(String sqlType)
+ {
+ this.sqlType = sqlType;
+ }
+
+ public String getKey()
+ {
+ return javaType;
+ }
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUnknownPkMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUnknownPkMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUnknownPkMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,226 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * A UnknownPkMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPUnknownPkMetaData
+{
+ private String keyGeneratorFactory;
+ private String unknownPkClass;
+ private String fieldName;
+ private boolean readOnly;
+ private long readOnlyTimeOut;
+ private String columnName;
+ private int jdbcType;
+ private String sqlType;
+ private boolean autoIncrement;
+
+ /**
+ * Get the autoIncrement.
+ *
+ * @return the autoIncrement.
+ */
+
+ public boolean isAutoIncrement()
+ {
+ return autoIncrement;
+ }
+ /**
+ * Set the autoIncrement.
+ *
+ * @param autoIncrement The autoIncrement to set.
+ */
+
+ public void setAutoIncrement(boolean autoIncrement)
+ {
+ this.autoIncrement = autoIncrement;
+ }
+ /**
+ * Get the columnName.
+ *
+ * @return the columnName.
+ */
+
+ public String getColumnName()
+ {
+ return columnName;
+ }
+ /**
+ * Set the columnName.
+ *
+ * @param columnName The columnName to set.
+ */
+
+ public void setColumnName(String columnName)
+ {
+ this.columnName = columnName;
+ }
+ /**
+ * Get the fieldName.
+ *
+ * @return the fieldName.
+ */
+
+ public String getFieldName()
+ {
+ return fieldName;
+ }
+ /**
+ * Set the fieldName.
+ *
+ * @param fieldName The fieldName to set.
+ */
+
+ public void setFieldName(String fieldName)
+ {
+ this.fieldName = fieldName;
+ }
+ /**
+ * Get the jdbcType.
+ *
+ * @return the jdbcType.
+ */
+
+ public int getJdbcType()
+ {
+ return jdbcType;
+ }
+
+ /**
+ * Set the jdbcType.
+ *
+ * @param jdbcType The jdbcType to set.
+ */
+ @XmlJavaTypeAdapter(value=JDBCTypeAdapter.class)
+ public void setJdbcType(int jdbcType)
+ {
+ this.jdbcType = jdbcType;
+ }
+ /**
+ * Get the keyGeneratorFactory.
+ *
+ * @return the keyGeneratorFactory.
+ */
+
+ public String getKeyGeneratorFactory()
+ {
+ return keyGeneratorFactory;
+ }
+ /**
+ * Set the keyGeneratorFactory.
+ *
+ * @param keyGeneratorFactory The keyGeneratorFactory to set.
+ */
+
+ public void setKeyGeneratorFactory(String keyGeneratorFactory)
+ {
+ this.keyGeneratorFactory = keyGeneratorFactory;
+ }
+ /**
+ * Get the readOnly.
+ *
+ * @return the readOnly.
+ */
+
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+ /**
+ * Set the readOnly.
+ *
+ * @param readOnly The readOnly to set.
+ */
+
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+ /**
+ * Get the readOnlyTimeOut.
+ *
+ * @return the readOnlyTimeOut.
+ */
+
+ public long getReadOnlyTimeOut()
+ {
+ return readOnlyTimeOut;
+ }
+ /**
+ * Set the readOnlyTimeOut.
+ *
+ * @param readOnlyTimeOut The readOnlyTimeOut to set.
+ */
+
+ public void setReadOnlyTimeOut(long readOnlyTimeOut)
+ {
+ this.readOnlyTimeOut = readOnlyTimeOut;
+ }
+ /**
+ * Get the sqlType.
+ *
+ * @return the sqlType.
+ */
+
+ public String getSqlType()
+ {
+ return sqlType;
+ }
+ /**
+ * Set the sqlType.
+ *
+ * @param sqlType The sqlType to set.
+ */
+
+ public void setSqlType(String sqlType)
+ {
+ this.sqlType = sqlType;
+ }
+ /**
+ * Get the unknownPkClass.
+ *
+ * @return the unknownPkClass.
+ */
+
+ public String getUnknownPkClass()
+ {
+ return unknownPkClass;
+ }
+ /**
+ * Set the unknownPkClass.
+ *
+ * @param unknownPkClass The unknownPkClass to set.
+ */
+
+ public void setUnknownPkClass(String unknownPkClass)
+ {
+ this.unknownPkClass = unknownPkClass;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUserTypeMappingMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUserTypeMappingMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPUserTypeMappingMetaData.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+
+/**
+ * A JBossCMPUserTypeMappingsMetaData.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPUserTypeMappingMetaData
+{
+
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JDBCTypeAdapter.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JDBCTypeAdapter.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JDBCTypeAdapter.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,207 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb.metadata.jboss.cmp;
+
+import java.sql.Types;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+
+/**
+ * A JDBCTypeAdapter.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JDBCTypeAdapter extends XmlAdapter<String, Integer>
+{
+ @Override
+ public String marshal(Integer arg0) throws Exception
+ {
+ String result = null;
+ switch(arg0)
+ {
+ case Types.ARRAY:
+ result = "ARRAY";
+ break;
+ case Types.BIGINT:
+ result = "BIGINT";
+ break;
+ case Types.BINARY:
+ result = "BINARY";
+ break;
+ case Types.BIT:
+ result = "BIT";
+ break;
+ case Types.BLOB:
+ result = "BLOB";
+ break;
+ case Types.BOOLEAN:
+ result = "BOOLEAN";
+ break;
+ case Types.CHAR:
+ result = "CHAR";
+ break;
+ case Types.CLOB:
+ result = "CLOB";
+ break;
+ case Types.DATALINK:
+ result = "DATALINK";
+ break;
+ case Types.DATE:
+ result = "DATE";
+ break;
+ case Types.DECIMAL:
+ result = "DECIMAL";
+ break;
+ case Types.DISTINCT:
+ result = "DISTINCT";
+ break;
+ case Types.DOUBLE:
+ result = "DOUBLE";
+ break;
+ case Types.FLOAT:
+ result = "FLOAT";
+ break;
+ case Types.INTEGER:
+ result = "INTEGER";
+ break;
+ case Types.JAVA_OBJECT:
+ result = "JAVA_OBJECT";
+ break;
+ case Types.LONGVARBINARY:
+ result = "LONGVARBINARY";
+ break;
+ case Types.LONGVARCHAR:
+ result = "LONGVARCHAR";
+ break;
+ case Types.NULL:
+ result = "NULL";
+ break;
+ case Types.NUMERIC:
+ result = "NUMERIC";
+ break;
+ case Types.OTHER:
+ result = "OTHER";
+ break;
+ case Types.REAL:
+ result = "REAL";
+ break;
+ case Types.REF:
+ result = "REF";
+ break;
+ case Types.SMALLINT:
+ result = "SMALLINT";
+ break;
+ case Types.STRUCT:
+ result = "STRUCT";
+ break;
+ case Types.TIME:
+ result = "TIME";
+ break;
+ case Types.TIMESTAMP:
+ result = "TIMESTAMP";
+ break;
+ case Types.TINYINT:
+ result = "TINYINT";
+ break;
+ case Types.VARBINARY:
+ result = "VARBINARY";
+ break;
+ case Types.VARCHAR:
+ result = "VARCHAR";
+ break;
+ default:
+ throw new IllegalArgumentException("Unexpected jdbc type: " + arg0);
+ }
+ return result;
+ }
+
+ @Override
+ public Integer unmarshal(String arg0) throws Exception
+ {
+ Integer result;
+ if("ARRAY".equals(arg0))
+ result = Types.ARRAY;
+ else if("BIGINT".equals(arg0))
+ result = Types.BIGINT;
+ else if("BINARY".equals(arg0))
+ result = Types.BINARY;
+ else if("BIT".equals(arg0))
+ result = Types.BIT;
+ else if("BLOB".equals(arg0))
+ result = Types.BLOB;
+ else if("BOOLEAN".equals(arg0))
+ result = Types.BOOLEAN;
+ else if("CHAR".equals(arg0))
+ result = Types.CHAR;
+ else if("CLOB".equals(arg0))
+ result = Types.CLOB;
+ else if("DATALINK".equals(arg0))
+ result = Types.DATALINK;
+ else if("DATE".equals(arg0))
+ result = Types.DATE;
+ else if("DECIMAL".equals(arg0))
+ result = Types.DECIMAL;
+ else if("DISTINCT".equals(arg0))
+ result = Types.DISTINCT;
+ else if("DOUBLE".equals(arg0))
+ result = Types.DOUBLE;
+ else if("FLOAT".equals(arg0))
+ result = Types.FLOAT;
+ else if("INTEGER".equals(arg0))
+ result = Types.INTEGER;
+ else if("JAVA_OBJECT".equals(arg0))
+ result = Types.JAVA_OBJECT;
+ else if("LONGVARBINARY".equals(arg0))
+ result = Types.LONGVARBINARY;
+ else if("LONGVARCHAR".equals(arg0))
+ result = Types.LONGVARCHAR;
+ else if("NULL".equals(arg0))
+ result = Types.NULL;
+ else if("NUMERIC".equals(arg0))
+ result = Types.NUMERIC;
+ else if("OTHER".equals(arg0))
+ result = Types.OTHER;
+ else if("REAL".equals(arg0))
+ result = Types.REAL;
+ else if("REF".equals(arg0))
+ result = Types.REF;
+ else if("SMALLINT".equals(arg0))
+ result = Types.SMALLINT;
+ else if("STRUCT".equals(arg0))
+ result = Types.STRUCT;
+ else if("TIME".equals(arg0))
+ result = Types.TIME;
+ else if("TIMESTAMP".equals(arg0))
+ result = Types.TIMESTAMP;
+ else if("TINYINT".equals(arg0))
+ result = Types.TINYINT;
+ else if("VARBINARY".equals(arg0))
+ result = Types.VARBINARY;
+ else if("VARCHAR".equals(arg0))
+ result = Types.VARCHAR;
+ else
+ throw new IllegalArgumentException("Unexpected JDBC type: " + arg0);
+ return result;
+ }
+}
Modified: jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/EJBMetaDataTestSuite.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/EJBMetaDataTestSuite.java 2007-08-24 22:04:14 UTC (rev 2512)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/EJBMetaDataTestSuite.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -48,6 +48,7 @@
suite.addTest(EjbJar21EverythingUnitTestCase.suite());
suite.addTest(JBoss5xEverythingUnitTestCase.suite());
suite.addTest(EjbJarJBossMergeEverythingUnitTestCase.suite());
+ suite.addTest(JBossCMPUnitTestCase.suite());
return suite;
}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/JBossCMPUnitTestCase.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/JBossCMPUnitTestCase.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/ejb/metadata/test/JBossCMPUnitTestCase.java 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,307 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb.metadata.test;
+
+import java.sql.Types;
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.ejb.metadata.jboss.cmp.JBossCMPDefaultsMetaData;
+import org.jboss.ejb.metadata.jboss.cmp.JBossCMPEntityCommandMetaData;
+import org.jboss.ejb.metadata.jboss.cmp.JBossCMPMetaData;
+import org.jboss.ejb.metadata.jboss.cmp.JBossCMPPreferredRelationMapping;
+import org.jboss.ejb.metadata.jboss.cmp.JBossCMPReadAheadMetaData;
+import org.jboss.ejb.metadata.jboss.cmp.JBossCMPTypeMappingMetaData;
+import org.jboss.ejb.metadata.jboss.cmp.JBossCMPUnknownPkMetaData;
+import org.jboss.test.ejb.AbstractEJBEverythingTest;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+
+/**
+ * A JBossCMPDefaultsUnitTestCase.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossCMPUnitTestCase extends AbstractEJBEverythingTest
+{
+ public static Test suite()
+ {
+ return suite(JBossCMPUnitTestCase.class);
+ }
+
+ public static SchemaBindingResolver initResolver()
+ {
+ return schemaResolverForClass(JBossCMPMetaData.class);
+ }
+
+ public JBossCMPUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected JBossCMPMetaData unmarshal() throws Exception
+ {
+ return unmarshal(JBossCMPMetaData.class);
+ }
+
+ public void testDefaults() throws Exception
+ {
+ //enableTrace("org.jboss.xb");
+ //enableTrace("org.jboss.xb.builder");
+
+ JBossCMPMetaData jbossMetaData = unmarshal();
+ assertNotNull(jbossMetaData);
+
+ JBossCMPDefaultsMetaData defaults = jbossMetaData.getDefaults();
+ assertNotNull(defaults);
+ assertEquals("java:/DefaultDS", defaults.getDatasource());
+ assertEquals("Hypersonic SQL", defaults.getDatasourceMapping());
+ assertTrue(defaults.isCreateTable());
+ assertTrue(defaults.isRemoveTable());
+ assertTrue(defaults.isReadOnly());
+ assertEquals(300000, defaults.getReadTimeOut());
+ assertTrue(defaults.isRowLocking());
+ assertTrue(defaults.isPkConstraint());
+ assertTrue(defaults.isFkConstraint());
+ assertEquals(JBossCMPPreferredRelationMapping.ForeignKey, defaults.getPreferredRelationMapping());
+
+ JBossCMPReadAheadMetaData readAhead = defaults.getReadAhead();
+ assertNotNull(readAhead);
+ assertEquals("on-load", readAhead.getStrategy());
+ assertEquals(1000, readAhead.getPageSize());
+ assertEquals("*", readAhead.getEagerLoadGroup());
+
+ assertEquals(1000, defaults.getListCacheMax());
+ assertTrue(defaults.isCleanReadAheadOnLoad());
+
+ JBossCMPUnknownPkMetaData unknownPk = defaults.getUnknownPk();
+ assertNotNull(unknownPk);
+ assertEquals("UUIDKeyGeneratorFactory", unknownPk.getKeyGeneratorFactory());
+ assertEquals("java.lang.String", unknownPk.getUnknownPkClass());
+ assertEquals(Types.VARCHAR, unknownPk.getJdbcType());
+ assertEquals("VARCHAR(32)", unknownPk.getSqlType());
+ assertNull(unknownPk.getColumnName());
+ assertNull(unknownPk.getFieldName());
+ assertEquals(0, unknownPk.getReadOnlyTimeOut());
+
+ JBossCMPEntityCommandMetaData entityCommand = defaults.getEntityCommand();
+ assertNotNull(entityCommand);
+ assertEquals("default", entityCommand.getName());
+ assertNull(entityCommand.getClassName());
+ assertTrue(entityCommand.isEmpty());
+
+ assertEquals("org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLCompiler", defaults.getQlCompiler());
+ assertTrue(defaults.isThrowRuntimeExceptions());
+ }
+
+ public void testTypeMappings() throws Exception
+ {
+ //enableTrace("org.jboss.xb.builder");
+
+ JBossCMPMetaData jbossMetaData = unmarshal();
+ assertNotNull(jbossMetaData);
+ assertNull(jbossMetaData.getDefaults());
+
+ List<JBossCMPTypeMappingMetaData> typeMappings = jbossMetaData.getTypeMappings();
+ assertNotNull(typeMappings);
+ assertEquals(2, typeMappings.size());
+
+ JBossCMPTypeMappingMetaData typeMapping = typeMappings.get(0);
+ assertNotNull(typeMapping);
+ assertEquals("Hypersonic SQL", typeMapping.getName());
+ assertEquals("", typeMapping.getRowLockingTemplate());
+ assertEquals("CONSTRAINT ?1 PRIMARY KEY (?2)", typeMapping.getPkConstraintTemplate());
+ assertEquals("ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)", typeMapping.getFkConstraintTemplate());
+ assertEquals("?1 IDENTITY", typeMapping.getAutoIncrementTemplate());
+ assertEquals("ALTER TABLE ?1 ADD COLUMN ?2 ?3", typeMapping.getAddColumnTemplate());
+ assertEquals("ALTER TABLE ?1 DROP COLUMN ?2", typeMapping.getDropColumnTemplate());
+ assertEquals("t", typeMapping.getAliasHeaderPrefix());
+ assertEquals("_", typeMapping.getAliasHeaderSuffix());
+ assertEquals(32, typeMapping.getAliasMaxLength());
+ assertTrue(typeMapping.isSubquerySupported());
+ assertEquals("(1=1)", typeMapping.getTrueMapping());
+ assertEquals("(1=0)", typeMapping.getFalseMapping());
+
+ assertNotNull(typeMapping.getFunctionMappings());
+ assertEquals(9, typeMapping.getFunctionMappings().size());
+ assertEquals("(?1 || ?2)", typeMapping.getFunctionSql("concat"));
+ assertEquals("SUBSTRING(?1, ?2, ?3)", typeMapping.getFunctionSql("substring"));
+ assertEquals("lcase(?1)", typeMapping.getFunctionSql("lcase"));
+ assertEquals("LENGTH(?1)", typeMapping.getFunctionSql("length"));
+ assertEquals("LOCATE(?1, ?2, ?3)", typeMapping.getFunctionSql("locate"));
+ assertEquals("ABS(?1)", typeMapping.getFunctionSql("abs"));
+ assertEquals("SQRT(?1)", typeMapping.getFunctionSql("sqrt"));
+ assertEquals("ucase(?1)", typeMapping.getFunctionSql("ucase"));
+ assertEquals("count(?1)", typeMapping.getFunctionSql("count"));
+
+ assertNotNull(typeMapping.getMappings());
+ assertEquals(15, typeMapping.getMappings().size());
+ assertEquals(Types.SMALLINT, typeMapping.getJdbcType(Byte.class.getName()));
+ assertEquals("SMALLINT", typeMapping.getSqlType(Byte.class.getName()));
+ assertEquals(Types.TIMESTAMP, typeMapping.getJdbcType(java.util.Date.class.getName()));
+ assertEquals("TIMESTAMP", typeMapping.getSqlType(java.util.Date.class.getName()));
+ assertEquals(Types.BIT, typeMapping.getJdbcType(Boolean.class.getName()));
+ assertEquals("BIT", typeMapping.getSqlType(Boolean.class.getName()));
+ assertEquals(Types.INTEGER, typeMapping.getJdbcType(Integer.class.getName()));
+ assertEquals("INTEGER", typeMapping.getSqlType(Integer.class.getName()));
+ assertEquals(Types.VARBINARY, typeMapping.getJdbcType(Object.class.getName()));
+ assertEquals("VARBINARY", typeMapping.getSqlType(Object.class.getName()));
+ assertEquals(Types.SMALLINT, typeMapping.getJdbcType(Short.class.getName()));
+ assertEquals("SMALLINT", typeMapping.getSqlType(Short.class.getName()));
+ assertEquals(Types.CHAR, typeMapping.getJdbcType(Character.class.getName()));
+ assertEquals("CHAR", typeMapping.getSqlType(Character.class.getName()));
+ assertEquals(Types.VARCHAR, typeMapping.getJdbcType(String.class.getName()));
+ assertEquals("VARCHAR(256)", typeMapping.getSqlType(String.class.getName()));
+ assertEquals(Types.DATE, typeMapping.getJdbcType(java.sql.Date.class.getName()));
+ assertEquals("DATE", typeMapping.getSqlType(java.sql.Date.class.getName()));
+ assertEquals(Types.TIME, typeMapping.getJdbcType(java.sql.Time.class.getName()));
+ assertEquals("TIME", typeMapping.getSqlType(java.sql.Time.class.getName()));
+ assertEquals(Types.TIMESTAMP, typeMapping.getJdbcType(java.sql.Timestamp.class.getName()));
+ assertEquals("TIMESTAMP", typeMapping.getSqlType(java.sql.Timestamp.class.getName()));
+ assertEquals(Types.REAL, typeMapping.getJdbcType(Float.class.getName()));
+ assertEquals("REAL", typeMapping.getSqlType(Float.class.getName()));
+ assertEquals(Types.BIGINT, typeMapping.getJdbcType(Long.class.getName()));
+ assertEquals("BIGINT", typeMapping.getSqlType(Long.class.getName()));
+ assertEquals(Types.DOUBLE, typeMapping.getJdbcType(Double.class.getName()));
+ assertEquals("DOUBLE", typeMapping.getSqlType(Double.class.getName()));
+ assertEquals(Types.DECIMAL, typeMapping.getJdbcType(java.math.BigDecimal.class.getName()));
+ assertEquals("DECIMAL", typeMapping.getSqlType(java.math.BigDecimal.class.getName()));
+
+ typeMapping = typeMappings.get(1);
+ assertNotNull(typeMapping);
+ assertEquals("Oracle9i", typeMapping.getName());
+ assertEquals("SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE", typeMapping.getRowLockingTemplate());
+ assertEquals("CONSTRAINT ?1 PRIMARY KEY (?2)", typeMapping.getPkConstraintTemplate());
+ assertEquals("ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)", typeMapping.getFkConstraintTemplate());
+ assertNull(typeMapping.getAutoIncrementTemplate());
+ assertNull(typeMapping.getAddColumnTemplate());
+ assertNull(typeMapping.getDropColumnTemplate());
+ assertEquals("t", typeMapping.getAliasHeaderPrefix());
+ assertEquals("_", typeMapping.getAliasHeaderSuffix());
+ assertEquals(30, typeMapping.getAliasMaxLength());
+ assertTrue(typeMapping.isSubquerySupported());
+ assertEquals("1", typeMapping.getTrueMapping());
+ assertEquals("0", typeMapping.getFalseMapping());
+
+ assertNotNull(typeMapping.getFunctionMappings());
+ assertEquals(9, typeMapping.getFunctionMappings().size());
+ assertEquals("(?1 || ?2)", typeMapping.getFunctionSql("concat"));
+ assertEquals("substr(?1, ?2, ?3)", typeMapping.getFunctionSql("substring"));
+ assertEquals("lower(?1)", typeMapping.getFunctionSql("lcase"));
+ assertEquals("length(?1)", typeMapping.getFunctionSql("length"));
+ assertEquals("instr(?2, ?1, ?3)", typeMapping.getFunctionSql("locate"));
+ assertEquals("abs(?1)", typeMapping.getFunctionSql("abs"));
+ assertEquals("sqrt(?1)", typeMapping.getFunctionSql("sqrt"));
+ assertEquals("upper(?1)", typeMapping.getFunctionSql("ucase"));
+ assertEquals("count(?1)", typeMapping.getFunctionSql("count"));
+
+ assertNotNull(typeMapping.getMappings());
+ assertEquals(15, typeMapping.getMappings().size());
+ assertEquals(Types.BIT, typeMapping.getJdbcType(Boolean.class.getName()));
+ assertEquals("NUMBER(1)", typeMapping.getSqlType(Boolean.class.getName()));
+ assertEquals(Types.SMALLINT, typeMapping.getJdbcType(Byte.class.getName()));
+ assertEquals("NUMBER(3)", typeMapping.getSqlType(Byte.class.getName()));
+ assertEquals(Types.NUMERIC, typeMapping.getJdbcType(Short.class.getName()));
+ assertEquals("NUMBER(5)", typeMapping.getSqlType(Short.class.getName()));
+ assertEquals(Types.INTEGER, typeMapping.getJdbcType(Integer.class.getName()));
+ assertEquals("NUMBER(10)", typeMapping.getSqlType(Integer.class.getName()));
+ assertEquals(Types.BIGINT, typeMapping.getJdbcType(Long.class.getName()));
+ assertEquals("NUMBER(19)", typeMapping.getSqlType(Long.class.getName()));
+ assertEquals(Types.REAL, typeMapping.getJdbcType(Float.class.getName()));
+ assertEquals("NUMBER(38,7)", typeMapping.getSqlType(Float.class.getName()));
+ assertEquals(Types.DECIMAL, typeMapping.getJdbcType(java.math.BigDecimal.class.getName()));
+ assertEquals("NUMBER(38,15)", typeMapping.getSqlType(java.math.BigDecimal.class.getName()));
+ assertEquals(Types.DOUBLE, typeMapping.getJdbcType(Double.class.getName()));
+ assertEquals("NUMBER(38,15)", typeMapping.getSqlType(Double.class.getName()));
+ assertEquals(Types.VARCHAR, typeMapping.getJdbcType(Character.class.getName()));
+ assertEquals("CHAR", typeMapping.getSqlType(Character.class.getName()));
+ assertEquals(Types.VARCHAR, typeMapping.getJdbcType(String.class.getName()));
+ assertEquals("VARCHAR2(255)", typeMapping.getSqlType(String.class.getName()));
+ assertEquals(Types.TIMESTAMP, typeMapping.getJdbcType(java.util.Date.class.getName()));
+ assertEquals("TIMESTAMP(3)", typeMapping.getSqlType(java.util.Date.class.getName()));
+ assertEquals(Types.DATE, typeMapping.getJdbcType(java.sql.Date.class.getName()));
+ assertEquals("DATE", typeMapping.getSqlType(java.sql.Date.class.getName()));
+ assertEquals(Types.TIME, typeMapping.getJdbcType(java.sql.Time.class.getName()));
+ assertEquals("DATE", typeMapping.getSqlType(java.sql.Time.class.getName()));
+ assertEquals(Types.TIMESTAMP, typeMapping.getJdbcType(java.sql.Timestamp.class.getName()));
+ assertEquals("TIMESTAMP(9)", typeMapping.getSqlType(java.sql.Timestamp.class.getName()));
+ assertEquals(Types.BLOB, typeMapping.getJdbcType(Object.class.getName()));
+ assertEquals("BLOB", typeMapping.getSqlType(Object.class.getName()));
+ }
+
+ public void testEntityCommands() throws Exception
+ {
+ //enableTrace("org.jboss.xb.builder");
+
+ JBossCMPMetaData jbossMetaData = unmarshal();
+ assertNotNull(jbossMetaData);
+ assertNull(jbossMetaData.getDefaults());
+ assertNull(jbossMetaData.getTypeMappings());
+
+ List<JBossCMPEntityCommandMetaData> entityCommands = jbossMetaData.getEntityCommands();
+ assertNotNull(entityCommands);
+ assertEquals(3, entityCommands.size());
+
+ JBossCMPEntityCommandMetaData cmd = entityCommands.get(0);
+ assertNotNull(cmd);
+ assertEquals("default", cmd.getName());
+ assertEquals("org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand", cmd.getClassName());
+ assertFalse(cmd.hasAttributes());
+
+ cmd = entityCommands.get(1);
+ assertNotNull(cmd);
+ assertEquals("no-select-before-insert", cmd.getName());
+ assertEquals("org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand", cmd.getClassName());
+ assertTrue(cmd.hasAttributes());
+ assertEquals("jboss.jdbc:service=SQLExceptionProcessor", cmd.getAttribute("SQLExceptionProcessor"));
+
+ cmd = entityCommands.get(2);
+ assertNotNull(cmd);
+ assertEquals("another", cmd.getName());
+ assertEquals("JDBCAnotherCreateCommand", cmd.getClassName());
+ assertTrue(cmd.hasAttributes());
+ assertEquals("val1", cmd.getAttribute("attr1"));
+ assertEquals("val2", cmd.getAttribute("attr2"));
+ assertNull(cmd.getAttribute("attr3"));
+ }
+
+ public void testReservedWords() throws Exception
+ {
+ //enableTrace("org.jboss.xb.builder");
+
+ JBossCMPMetaData jbossMetaData = unmarshal();
+ assertNotNull(jbossMetaData);
+ assertNull(jbossMetaData.getDefaults());
+ assertNull(jbossMetaData.getTypeMappings());
+ assertNull(jbossMetaData.getEntityCommands());
+
+ List<String> reservedWords = jbossMetaData.getReservedWords();
+ assertNotNull(reservedWords);
+ assertEquals(3, reservedWords.size());
+ for(int i = 1; i <= reservedWords.size(); ++i)
+ {
+ assertEquals("word" + i, reservedWords.get(i));
+ }
+ }
+}
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testDefaults.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testDefaults.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testDefaults.xml 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscmp-jdbc xmlns="http://www.jboss.com/xml/ns/javaee/cmp2x"
+ xmlns:jee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee/cmp2x http://www.jboss.org/j2ee/schema/jbosscmp-jdbc_5_0.xsd">
+
+ <defaults>
+ <datasource>java:/DefaultDS</datasource>
+ <datasource-mapping>Hypersonic SQL</datasource-mapping>
+
+ <create-table>true</create-table>
+ <remove-table>true</remove-table>
+ <read-only>true</read-only>
+ <read-time-out>300000</read-time-out>
+ <row-locking>true</row-locking>
+ <pk-constraint>true</pk-constraint>
+ <fk-constraint>true</fk-constraint>
+ <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
+ <read-ahead>
+ <strategy>on-load</strategy>
+ <page-size>1000</page-size>
+ <eager-load-group>*</eager-load-group>
+ </read-ahead>
+ <list-cache-max>1000</list-cache-max>
+ <clean-read-ahead-on-load>true</clean-read-ahead-on-load>
+
+ <unknown-pk>
+ <key-generator-factory>UUIDKeyGeneratorFactory</key-generator-factory>
+ <unknown-pk-class>java.lang.String</unknown-pk-class>
+ <jdbc-type>VARCHAR</jdbc-type>
+ <sql-type>VARCHAR(32)</sql-type>
+ </unknown-pk>
+
+ <entity-command name="default"/>
+ <ql-compiler>org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLCompiler</ql-compiler>
+ <throw-runtime-exceptions>true</throw-runtime-exceptions>
+ </defaults>
+</jbosscmp-jdbc>
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testEntityCommands.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testEntityCommands.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testEntityCommands.xml 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscmp-jdbc xmlns="http://www.jboss.com/xml/ns/javaee/cmp2x"
+ xmlns:jee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee/cmp2x http://www.jboss.org/j2ee/schema/jbosscmp-jdbc_5_0.xsd">
+
+ <entity-commands>
+ <!-- default command; doesn't support unknown-pk -->
+ <entity-command name="default"
+ class="org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand"/>
+
+ <!-- variation on default that skips select before insert -->
+ <entity-command name="no-select-before-insert"
+ class="org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand">
+ <attribute name="SQLExceptionProcessor">jboss.jdbc:service=SQLExceptionProcessor</attribute>
+ </entity-command>
+
+ <entity-command name="another"
+ class="JDBCAnotherCreateCommand">
+ <attribute name="attr1">val1</attribute>
+ <attribute name="attr2">val2</attribute>
+ </entity-command>
+ </entity-commands>
+
+</jbosscmp-jdbc>
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testReservedWords.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testReservedWords.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testReservedWords.xml 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscmp-jdbc xmlns="http://www.jboss.com/xml/ns/javaee/cmp2x"
+ xmlns:jee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee/cmp2x http://www.jboss.org/j2ee/schema/jbosscmp-jdbc_5_0.xsd">
+
+ <reserved-words>
+ <word>word1</word>
+ <word>word2</word>
+ <word>word3</word>
+ </reserved-words>
+
+</jbosscmp-jdbc>
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testTypeMappings.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testTypeMappings.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/ejb/metadata/test/JBossCMP_testTypeMappings.xml 2007-08-24 22:06:58 UTC (rev 2513)
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscmp-jdbc xmlns="http://www.jboss.com/xml/ns/javaee/cmp2x"
+ xmlns:jee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee/cmp2x http://www.jboss.org/j2ee/schema/jbosscmp-jdbc_5_0.xsd">
+
+ <type-mappings>
+ <type-mapping>
+ <name>Hypersonic SQL</name>
+ <row-locking-template/>
+ <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+ <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+ <auto-increment-template>?1 IDENTITY</auto-increment-template>
+ <add-column-template>ALTER TABLE ?1 ADD COLUMN ?2 ?3</add-column-template>
+ <drop-column-template>ALTER TABLE ?1 DROP COLUMN ?2</drop-column-template>
+ <alias-header-prefix>t</alias-header-prefix>
+ <alias-header-suffix>_</alias-header-suffix>
+ <alias-max-length>32</alias-max-length>
+ <subquery-supported>true</subquery-supported>
+ <true-mapping>(1=1)</true-mapping>
+ <false-mapping>(1=0)</false-mapping>
+
+ <function-mapping>
+ <function-name>concat</function-name>
+ <function-sql>(?1 || ?2)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>substring</function-name>
+ <function-sql>SUBSTRING(?1, ?2, ?3)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>lcase</function-name>
+ <function-sql>lcase(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>length</function-name>
+ <function-sql>LENGTH(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>locate</function-name>
+ <function-sql>LOCATE(?1, ?2, ?3)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>abs</function-name>
+ <function-sql>ABS(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>sqrt</function-name>
+ <function-sql>SQRT(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>ucase</function-name>
+ <function-sql>ucase(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>count</function-name>
+ <function-sql>count(?1)</function-sql>
+ </function-mapping>
+
+ <mapping>
+ <java-type>java.lang.Byte</java-type>
+ <jdbc-type>SMALLINT</jdbc-type>
+ <sql-type>SMALLINT</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.util.Date</java-type>
+ <jdbc-type>TIMESTAMP</jdbc-type>
+ <sql-type>TIMESTAMP</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Boolean</java-type>
+ <jdbc-type>BIT</jdbc-type>
+ <sql-type>BIT</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Integer</java-type>
+ <jdbc-type>INTEGER</jdbc-type>
+ <sql-type>INTEGER</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Object</java-type>
+ <!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
+ <jdbc-type>VARBINARY</jdbc-type>
+ <sql-type>VARBINARY</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Short</java-type>
+ <jdbc-type>SMALLINT</jdbc-type>
+ <sql-type>SMALLINT</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Character</java-type>
+ <jdbc-type>CHAR</jdbc-type>
+ <sql-type>CHAR</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.String</java-type>
+ <jdbc-type>VARCHAR</jdbc-type>
+ <sql-type>VARCHAR(256)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.sql.Date</java-type>
+ <jdbc-type>DATE</jdbc-type>
+ <sql-type>DATE</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.sql.Time</java-type>
+ <jdbc-type>TIME</jdbc-type>
+ <sql-type>TIME</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.sql.Timestamp</java-type>
+ <jdbc-type>TIMESTAMP</jdbc-type>
+ <sql-type>TIMESTAMP</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Float</java-type>
+ <jdbc-type>REAL</jdbc-type>
+ <sql-type>REAL</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Long</java-type>
+ <jdbc-type>BIGINT</jdbc-type>
+ <sql-type>BIGINT</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Double</java-type>
+ <jdbc-type>DOUBLE</jdbc-type>
+ <sql-type>DOUBLE</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.math.BigDecimal</java-type>
+ <jdbc-type>DECIMAL</jdbc-type>
+ <sql-type>DECIMAL</sql-type>
+ </mapping>
+ </type-mapping>
+
+ <type-mapping>
+ <name>Oracle9i</name>
+ <!--
+ | Make sure that you have the Oracle 9i version of classes12.jar
+ | or you will suffer
+ -->
+ <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE</row-locking-template>
+ <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+ <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+ <alias-header-prefix>t</alias-header-prefix>
+ <alias-header-suffix>_</alias-header-suffix>
+ <alias-max-length>30</alias-max-length>
+ <subquery-supported>true</subquery-supported>
+ <true-mapping>1</true-mapping>
+ <false-mapping>0</false-mapping>
+
+ <function-mapping>
+ <function-name>concat</function-name>
+ <function-sql>(?1 || ?2)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>substring</function-name>
+ <function-sql>substr(?1, ?2, ?3)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>lcase</function-name>
+ <function-sql>lower(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>length</function-name>
+ <function-sql>length(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>locate</function-name>
+ <function-sql>instr(?2, ?1, ?3)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>abs</function-name>
+ <function-sql>abs(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>sqrt</function-name>
+ <function-sql>sqrt(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>ucase</function-name>
+ <function-sql>upper(?1)</function-sql>
+ </function-mapping>
+ <function-mapping>
+ <function-name>count</function-name>
+ <function-sql>count(?1)</function-sql>
+ </function-mapping>
+
+ <mapping>
+ <java-type>java.lang.Boolean</java-type>
+ <jdbc-type>BIT</jdbc-type>
+ <sql-type>NUMBER(1)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Byte</java-type>
+ <jdbc-type>SMALLINT</jdbc-type>
+ <sql-type>NUMBER(3)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Short</java-type>
+ <jdbc-type>NUMERIC</jdbc-type>
+ <!-- <jdbc-type>SMALLINT</jdbc-type> this resulted in a ClassCastException -->
+ <sql-type>NUMBER(5)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Integer</java-type>
+ <jdbc-type>INTEGER</jdbc-type>
+ <sql-type>NUMBER(10)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Long</java-type>
+ <jdbc-type>BIGINT</jdbc-type>
+ <sql-type>NUMBER(19)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Float</java-type>
+ <jdbc-type>REAL</jdbc-type>
+ <sql-type>NUMBER(38,7)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.math.BigDecimal</java-type>
+ <jdbc-type>DECIMAL</jdbc-type>
+ <sql-type>NUMBER(38,15)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Double</java-type>
+ <jdbc-type>DOUBLE</jdbc-type>
+ <sql-type>NUMBER(38,15)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Character</java-type>
+ <jdbc-type>VARCHAR</jdbc-type>
+ <sql-type>CHAR</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.String</java-type>
+ <jdbc-type>VARCHAR</jdbc-type>
+ <sql-type>VARCHAR2(255)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.util.Date</java-type>
+ <jdbc-type>TIMESTAMP</jdbc-type>
+ <sql-type>TIMESTAMP(3)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.sql.Date</java-type>
+ <jdbc-type>DATE</jdbc-type>
+ <sql-type>DATE</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.sql.Time</java-type>
+ <jdbc-type>TIME</jdbc-type>
+ <sql-type>DATE</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.sql.Timestamp</java-type>
+ <jdbc-type>TIMESTAMP</jdbc-type>
+ <sql-type>TIMESTAMP(9)</sql-type>
+ </mapping>
+ <mapping>
+ <java-type>java.lang.Object</java-type>
+ <jdbc-type>BLOB</jdbc-type>
+ <sql-type>BLOB</sql-type>
+ <!--
+ | Change this from BLOB to RAW(n) if you know your
+ | serialized object will be <= n bytes and n <= 2000
+ -->
+ </mapping>
+ </type-mapping>
+ </type-mappings>
+
+</jbosscmp-jdbc>
More information about the jboss-svn-commits
mailing list