Examples of JDBCEntityCommandMetaData


Examples of org.jboss.as.cmp.jdbc.metadata.JDBCEntityCommandMetaData

        return parsedCmpField;
    }

    private static JDBCEntityCommandMetaData parseEntityCommand(final XMLStreamReader reader, final ClassLoader classLoader) throws XMLStreamException {

        final JDBCEntityCommandMetaData metaData = new JDBCEntityCommandMetaData();

        final int count = reader.getAttributeCount();
        for (int i = 0; i < count; i++) {
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            switch (attribute) {
                case NAME: {
                    metaData.setName(reader.getAttributeValue(i));
                    break;
                }
                case CLASS: {
                    final String command = reader.getAttributeValue(i);
                    try {
                        metaData.setClass(classLoader.loadClass(command));
                    } catch (ClassNotFoundException e) {
                        throw MESSAGES.failedToLoadEntityCommand(command, e);
                    }
                    break;
                }
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCEntityCommandMetaData

        bridgeInvocationHandler = new EntityBridgeInvocationHandler(createFieldMap(entityBridge), createSelectorMap(entityBridge, queryFactory));

        startCmd = new JDBCStartCommand(this);
        startCmd.execute();

        final JDBCEntityCommandMetaData entityCommand = getMetaData().getEntityCommand();
        if (entityCommand == null || "default".equals(entityCommand.getCommandName())) {
            createCmd = new ApplicationPkCreateCommand();
        } else {
            final Class cmdClass = entityCommand.getCommandClass();
            if (cmdClass == null) {
                throw CmpMessages.MESSAGES.entityCommandClassNotSpecified(entityBridge.getEntityName());
            }

            try {
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCEntityCommandMetaData

public class HsqldbCreateCommand extends AbstractCreateCommand {

    public void init(JDBCStoreManager2 manager) {
        super.init(manager);

        JDBCEntityCommandMetaData metadata = entityBridge.getMetaData().getEntityCommand();
        pkSql = metadata.getAttribute("pk-sql");
        if (pkSql == null) {
            pkSql = "CALL IDENTITY()";
        }

        if (log.isDebugEnabled()) {
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCEntityCommandMetaData

public class PostgreSQLCreateCommand extends AbstractCreateCommand {

    public void init(JDBCStoreManager2 manager) {
        super.init(manager);

        JDBCEntityCommandMetaData metadata = entityBridge.getMetaData().getEntityCommand();
        String sequence = metadata.getAttribute("sequence");
        if (sequence == null) {
            sequence = entityBridge.getQualifiedTableName()
                    + '_' + SQLUtil.getColumnNamesClause(pkField, new StringBuffer(20))
                    + "_seq";
        }
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCEntityCommandMetaData

        if (pkFields.length > 1) {
            throw CmpMessages.MESSAGES.entityCommandCanNotBeUsedWithCompositePk();
        }
        this.pkField = (JDBCCMPFieldBridge2) pkFields[0];

        JDBCEntityCommandMetaData metadata = entityBridge.getMetaData().getEntityCommand();
        pkSql = metadata.getAttribute("pk-sql");
        if (pkSql == null) {
            throw CmpMessages.MESSAGES.pkSqlAttributeNotSet(entityBridge.getEntityName());
        }
        if (log.isDebugEnabled()) {
            log.debug("entity-command generate pk sql: " + pkSql);
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCEntityCommandMetaData

            }
        }

        initGeneratedFields();

        JDBCEntityCommandMetaData entityCommand = manager.getMetaData().getEntityCommand();
        if (entityCommand == null) {
            throw MESSAGES.entityCommandIsNull();
        }
        initEntityCommand(entityCommand);
View Full Code Here

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCEntityCommandMetaData

    }

    public JDBCCreateCommand createCreateEntityCommand() {
        JDBCCreateCommand cec;
        try {
            JDBCEntityCommandMetaData commandMetaData = manager.getMetaData().getEntityCommand();
            if(commandMetaData.getCommandClass() == null) {
                commandMetaData = manager.getMetaData().getJDBCApplication().getEntityCommandByName(commandMetaData.getCommandName());
            }
            cec = (JDBCCreateCommand) commandMetaData.getCommandClass().newInstance();
            cec.init(manager);
        } catch (Exception e) {
            throw CmpMessages.MESSAGES.couldNotCreateEntityCommand(e);
        }
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData

      instanceFactory = new InstanceFactory(this, entityBridge);

      startCmd = new JDBCStartCommand(this);
      startCmd.execute();

      final JDBCEntityCommandMetaData entityCommand = getMetaData().getEntityCommand();
      if(entityCommand == null || "default".equals(entityCommand.getCommandName()))
      {
         createCmd = new ApplicationPkCreateCommand();
      }
      else
      {
         final Class cmdClass = entityCommand.getCommandClass();
         if(cmdClass == null)
         {
            throw new DeploymentException(
               "entity-command class name is not specified for entity " + entityBridge.getEntityName()
            );
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData

   public void init(JDBCStoreManager2 manager) throws DeploymentException
   {
      super.init(manager);

      JDBCEntityCommandMetaData metadata = entityBridge.getMetaData().getEntityCommand();
      pkSql = metadata.getAttribute("pk-sql");
      if(pkSql == null)
      {
         pkSql = "CALL IDENTITY()";
      }
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData

   public void init(JDBCStoreManager2 manager) throws DeploymentException
   {
      super.init(manager);

      JDBCEntityCommandMetaData metadata = entityBridge.getMetaData().getEntityCommand();
      String sequence = metadata.getAttribute("sequence");
      if (sequence == null) {
         sequence = entityBridge.getQualifiedTableName()
            + '_' + SQLUtil.getColumnNamesClause(pkField, new StringBuffer(20))
            + "_seq";
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.