Package com.amazonaws.services.simpledb.model

Examples of com.amazonaws.services.simpledb.model.ReplaceableAttribute


   
    for (Field field : ClassInfo.getClassInfo(clazz).updateFields) {
      try {
        String value = objectFieldToString(obj, field);
        if(value != null){
          ReplaceableAttribute attr = new ReplaceableAttribute(getAttributeName(field), value, true);
          req.withAttributes(attr);
        }else {
          if (ClassInfo.isEmbeddedNative(field)){
            SdbNativeSerializer.embed(req, ClassInfo.getSingleColumnName(field), value);           
          }
View Full Code Here


   
    for (Field field : ClassInfo.getClassInfo(clazz).updateFields) {
      try {
        String value = objectFieldToString(obj, field);
        if(value != null){
          ReplaceableAttribute attr = new ReplaceableAttribute(getAttributeName(field), value, true);
          item.withAttributes(attr);
        }else {
          if (ClassInfo.isEmbeddedNative(field)){
            SdbNativeSerializer.embed(item, ClassInfo.getSingleColumnName(field), value);           
          }
View Full Code Here

    }
   
    for (Field f : ClassInfo.getClassInfo(clazz).updateFields) {
      String propValue = SdbMappingUtils.objectFieldToString(embeddedObj, f);
      if(propValue != null){
        ReplaceableAttribute attr =
          new ReplaceableAttribute(
              getEmbeddedAttributeName(embeddingColumnName, f), propValue, true);
        req.withAttributes(attr);
      }else {
        if (ClassInfo.isEmbeddedNative(f)){
          SdbNativeSerializer.embed(
View Full Code Here

    }
   
    for (Field f : ClassInfo.getClassInfo(clazz).updateFields) {
      String propValue = SdbMappingUtils.objectFieldToString(embeddedObj, f);
      if(propValue != null){
        ReplaceableAttribute attr =
          new ReplaceableAttribute(
              getEmbeddedAttributeName(embeddingColumnName, f), propValue, true);
        item.withAttributes(attr);
      }else {
        if (ClassInfo.isEmbeddedNative(f)){
          SdbNativeSerializer.embed(
View Full Code Here

    Constants.getSDB().createDomain(new
        CreateDomainRequest(Constants.DOMAINSDB));
   
    List<ReplaceableItem> erros=new ArrayList<ReplaceableItem>(null);
    erros.add(new ReplaceableItem("LOG:").withAttributes(
        new ReplaceableAttribute("ID", getLastOccurrence()+"", true),
        new ReplaceableAttribute("LEVEL", level.getName(), true),
        new ReplaceableAttribute("MESSAGE", message, true),
        new ReplaceableAttribute("DATE", Calendar.getInstance().
            getTime().toString(), true)
        ));
    Constants.getSDB().batchPutAttributes(new
        BatchPutAttributesRequest(Constants.DOMAINSDB, erros));
   
View Full Code Here

    }
   
    @Test
    public void putAttributes() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        template.send("direct:start-sdb", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

    }

    @Test
    public void execute() {
        List<ReplaceableAttribute> replaceableAttributes = new ArrayList<ReplaceableAttribute>();
        replaceableAttributes.add(new ReplaceableAttribute("NAME1", "VALUE1", true));
        exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ATTRIBUTES, replaceableAttributes);
        exchange.getIn().setHeader(SdbConstants.ITEM_NAME, "ITEM1");
        UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
        exchange.getIn().setHeader(SdbConstants.UPDATE_CONDITION, updateCondition);
       
View Full Code Here

    }
   
    @Test(expected = IllegalArgumentException.class)
    public void executeWithoutItemName() {
        List<ReplaceableAttribute> replaceableAttributes = new ArrayList<ReplaceableAttribute>();
        replaceableAttributes.add(new ReplaceableAttribute("NAME1", "VALUE1", true));
        exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ATTRIBUTES, replaceableAttributes);
        UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
        exchange.getIn().setHeader(SdbConstants.UPDATE_CONDITION, updateCondition);
       
        command.execute();
View Full Code Here

    @Test
    public void determineReplaceableAttributes() {
        assertNull(this.command.determineReplaceableAttributes());

        List<ReplaceableAttribute> replaceableAttributes = new ArrayList<ReplaceableAttribute>();
        replaceableAttributes.add(new ReplaceableAttribute("NAME1", "VALUE1", true));
        exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ATTRIBUTES, replaceableAttributes);

        assertEquals(replaceableAttributes, this.command.determineReplaceableAttributes());
    }
View Full Code Here

    }
   
    @Test
    public void putAttributes() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        template.send("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpledb.model.ReplaceableAttribute

Copyright © 2018 www.massapicom. 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.