[jboss-cvs] JBossAS SVN: r59592 - in branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp: jdbc and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 12 03:46:23 EST 2007


Author: alex.loubyansky at jboss.com
Date: 2007-01-12 03:46:20 -0500 (Fri, 12 Jan 2007)
New Revision: 59592

Modified:
   branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/bridge/CMPFieldBridge.java
   branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java
   branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCFieldBridge.java
   branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMPFieldBridge2.java
Log:
JBAS-3975 support value classes in EJBQLToSQL92Compiler

Modified: branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/bridge/CMPFieldBridge.java
===================================================================
--- branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/bridge/CMPFieldBridge.java	2007-01-12 08:44:33 UTC (rev 59591)
+++ branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/bridge/CMPFieldBridge.java	2007-01-12 08:46:20 UTC (rev 59592)
@@ -1,26 +1,28 @@
 /*
- * 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.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.plugins.cmp.bridge;
 
-public interface CMPFieldBridge extends FieldBridge {
+import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCFieldBridge;
+
+public interface CMPFieldBridge extends JDBCFieldBridge {
    public Class getFieldType();
 }

Modified: branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java
===================================================================
--- branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java	2007-01-12 08:44:33 UTC (rev 59591)
+++ branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java	2007-01-12 08:46:20 UTC (rev 59592)
@@ -918,8 +918,6 @@
 
    public Object visit(ASTValueClassComparison node, Object data)
    {
-      throw new IllegalStateException("Value class comparison is not yet supported.");
-/*
       StringBuffer buf = (StringBuffer) data;
 
       boolean not = (node.opp.equals(SQLUtil.NOT_EQUAL));
@@ -976,7 +974,6 @@
       }
 
       return (not ? buf.append(')') : buf).append(')');
-*/
    }
 
    public Object visit(ASTEntityComparison node, Object data)
@@ -1244,18 +1241,24 @@
             + "Should have been handled at a higher level.");
       }
 
+      JDBCFieldBridge cmpField = (JDBCFieldBridge) node.getCMPField();
+
       // make sure this is mapped to a single column
       switch(node.type)
       {
          case EJBQLTypes.ENTITY_TYPE:
          case EJBQLTypes.VALUE_CLASS_TYPE:
+            if(cmpField.getJDBCType().hasMapper() ||
+               cmpField.getJDBCType().getParameterSetter() != null)
+            {
+               break;
+            }
          case EJBQLTypes.UNKNOWN_TYPE:
             throw new IllegalStateException("Can not visit multi-column path " +
                "node. Should have been handled at a higher level.");
       }
 
       addLeftJoinPath(node);
-      JDBCFieldBridge cmpField = (JDBCFieldBridge) node.getCMPField();
       String alias = aliasManager.getAlias(node.getPath(node.size() - 2));
       SQLUtil.getColumnNamesClause(cmpField, alias, buf);
       return data;

Modified: branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCFieldBridge.java
===================================================================
--- branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCFieldBridge.java	2007-01-12 08:44:33 UTC (rev 59591)
+++ branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCFieldBridge.java	2007-01-12 08:46:20 UTC (rev 59592)
@@ -1,24 +1,24 @@
 /*
- * 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.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.plugins.cmp.jdbc.bridge;
 
 import java.sql.PreparedStatement;

Modified: branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMPFieldBridge2.java
===================================================================
--- branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMPFieldBridge2.java	2007-01-12 08:44:33 UTC (rev 59591)
+++ branches/Branch_4_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMPFieldBridge2.java	2007-01-12 08:46:20 UTC (rev 59592)
@@ -1,24 +1,24 @@
 /*
- * 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.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.plugins.cmp.jdbc2.bridge;
 
 import org.jboss.ejb.plugins.cmp.bridge.CMPFieldBridge;
@@ -28,7 +28,6 @@
 import org.jboss.ejb.plugins.cmp.jdbc.JDBCType;
 import org.jboss.ejb.plugins.cmp.jdbc.JDBCEntityPersistenceStore;
 import org.jboss.ejb.plugins.cmp.jdbc.JDBCResultSetReader;
-import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCFieldBridge;
 import org.jboss.ejb.EntityEnterpriseContext;
 import org.jboss.deployment.DeploymentException;
 import org.jboss.logging.Logger;
@@ -44,7 +43,7 @@
  * @version <tt>$Revision$</tt>
  */
 public class JDBCCMPFieldBridge2
-   implements CMPFieldBridge, JDBCFieldBridge
+   implements CMPFieldBridge
 {
    private final JDBCEntityBridge2 entity;
    private final int rowIndex;




More information about the jboss-cvs-commits mailing list