This commit is contained in:
@@ -7,6 +7,7 @@ package org.redkale.convert.bson;
|
|||||||
|
|
||||||
import java.nio.*;
|
import java.nio.*;
|
||||||
import java.util.function.*;
|
import java.util.function.*;
|
||||||
|
import org.redkale.util.Utility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -77,21 +78,14 @@ public class BsonByteBufferWriter extends BsonWriter {
|
|||||||
ByteBuffer buffer = this.buffers[index];
|
ByteBuffer buffer = this.buffers[index];
|
||||||
if (!buffer.hasRemaining()) {
|
if (!buffer.hasRemaining()) {
|
||||||
buffer.flip();
|
buffer.flip();
|
||||||
buffer = supplier.get();
|
buffer = supplier.get();
|
||||||
ByteBuffer[] bufs = new ByteBuffer[this.buffers.length + 1];
|
this.buffers = Utility.append(this.buffers, buffer);
|
||||||
System.arraycopy(this.buffers, 0, bufs, 0, this.buffers.length);
|
|
||||||
bufs[this.buffers.length] = buffer;
|
|
||||||
this.buffers = bufs;
|
|
||||||
this.index++;
|
this.index++;
|
||||||
}
|
}
|
||||||
int len = buffer.remaining();
|
int len = buffer.remaining();
|
||||||
int size = 0;
|
int size = 0;
|
||||||
while (len < byteLength) {
|
while (len < byteLength) {
|
||||||
buffer = supplier.get();
|
this.buffers = Utility.append(this.buffers, buffer);
|
||||||
ByteBuffer[] bufs = new ByteBuffer[this.buffers.length + 1];
|
|
||||||
System.arraycopy(this.buffers, 0, bufs, 0, this.buffers.length);
|
|
||||||
bufs[this.buffers.length] = buffer;
|
|
||||||
this.buffers = bufs;
|
|
||||||
len += buffer.remaining();
|
len += buffer.remaining();
|
||||||
size++;
|
size++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,20 +84,14 @@ public class JsonByteBufferWriter extends JsonWriter {
|
|||||||
if (!buffer.hasRemaining()) {
|
if (!buffer.hasRemaining()) {
|
||||||
buffer.flip();
|
buffer.flip();
|
||||||
buffer = supplier.get();
|
buffer = supplier.get();
|
||||||
ByteBuffer[] bufs = new ByteBuffer[this.buffers.length + 1];
|
this.buffers = Utility.append(this.buffers, buffer);
|
||||||
System.arraycopy(this.buffers, 0, bufs, 0, this.buffers.length);
|
|
||||||
bufs[this.buffers.length] = buffer;
|
|
||||||
this.buffers = bufs;
|
|
||||||
this.index++;
|
this.index++;
|
||||||
}
|
}
|
||||||
int len = buffer.remaining();
|
int len = buffer.remaining();
|
||||||
int size = 0;
|
int size = 0;
|
||||||
while (len < byteLength) {
|
while (len < byteLength) {
|
||||||
buffer = supplier.get();
|
buffer = supplier.get();
|
||||||
ByteBuffer[] bufs = new ByteBuffer[this.buffers.length + 1];
|
this.buffers = Utility.append(this.buffers, buffer);
|
||||||
System.arraycopy(this.buffers, 0, bufs, 0, this.buffers.length);
|
|
||||||
bufs[this.buffers.length] = buffer;
|
|
||||||
this.buffers = bufs;
|
|
||||||
len += buffer.remaining();
|
len += buffer.remaining();
|
||||||
size++;
|
size++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import java.util.*;
|
|||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.function.*;
|
import java.util.function.*;
|
||||||
import static org.redkale.source.FilterExpress.EQUAL;
|
import static org.redkale.source.FilterExpress.EQUAL;
|
||||||
import org.redkale.util.Attribute;
|
import org.redkale.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -94,10 +94,7 @@ public class FilterJoinNode extends FilterNode {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if (or == signor || this.column == null) {
|
if (or == signor || this.column == null) {
|
||||||
FilterNode[] newsiblings = new FilterNode[nodes.length + 1];
|
this.nodes = Utility.append(this.nodes, node);
|
||||||
System.arraycopy(nodes, 0, newsiblings, 0, nodes.length);
|
|
||||||
newsiblings[nodes.length] = node;
|
|
||||||
this.nodes = newsiblings;
|
|
||||||
if (this.column == null) this.or = signor;
|
if (this.column == null) this.or = signor;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import java.lang.reflect.Array;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.*;
|
import java.util.function.*;
|
||||||
import static org.redkale.source.FilterExpress.*;
|
import static org.redkale.source.FilterExpress.*;
|
||||||
import org.redkale.util.Attribute;
|
import org.redkale.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注意: <br>
|
* 注意: <br>
|
||||||
@@ -150,10 +150,7 @@ public class FilterNode { //FilterNode 不能实现Serializable接口, 否则
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if (or == signor) {
|
if (or == signor) {
|
||||||
FilterNode[] newsiblings = new FilterNode[nodes.length + 1];
|
this.nodes = Utility.append(this.nodes, node);
|
||||||
System.arraycopy(nodes, 0, newsiblings, 0, nodes.length);
|
|
||||||
newsiblings[nodes.length] = node;
|
|
||||||
this.nodes = newsiblings;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
FilterNode newnode = new FilterNode(this.column, this.express, this.itemand, this.value);
|
FilterNode newnode = new FilterNode(this.column, this.express, this.itemand, this.value);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import java.util.*;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
import static org.redkale.source.FilterExpress.*;
|
import static org.redkale.source.FilterExpress.*;
|
||||||
import org.redkale.util.Attribute;
|
import org.redkale.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -117,10 +117,7 @@ public final class FilterNodeBean<T extends FilterBean> implements Comparable<Fi
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if (or == signor) {
|
if (or == signor) {
|
||||||
FilterNodeBean[] newsiblings = new FilterNodeBean[nodeBeans.length + 1];
|
this.nodeBeans = Utility.append(this.nodeBeans, node);
|
||||||
System.arraycopy(nodeBeans, 0, newsiblings, 0, nodeBeans.length);
|
|
||||||
newsiblings[nodeBeans.length] = node;
|
|
||||||
this.nodeBeans = newsiblings;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
this.nodeBeans = new FilterNodeBean[]{new FilterNodeBean(this), node};
|
this.nodeBeans = new FilterNodeBean[]{new FilterNodeBean(this), node};
|
||||||
|
|||||||
@@ -264,22 +264,13 @@ public abstract class AnyValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public DefaultAnyValue addValue(String name, String value) {
|
public DefaultAnyValue addValue(String name, String value) {
|
||||||
if (name == null) return this;
|
this.stringValues = Utility.append(this.stringValues, new Entry(name, value));
|
||||||
int len = this.stringValues.length;
|
|
||||||
Entry[] news = new Entry[len + 1];
|
|
||||||
System.arraycopy(this.stringValues, 0, news, 0, len);
|
|
||||||
news[len] = new Entry(name, value);
|
|
||||||
this.stringValues = news;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultAnyValue addValue(String name, AnyValue value) {
|
public DefaultAnyValue addValue(String name, AnyValue value) {
|
||||||
if (name == null || value == null) return this;
|
if (name == null || value == null) return this;
|
||||||
int len = this.entityValues.length;
|
this.entityValues = Utility.append(this.entityValues, new Entry(name, value));
|
||||||
Entry[] news = new Entry[len + 1];
|
|
||||||
System.arraycopy(this.entityValues, 0, news, 0, len);
|
|
||||||
news[len] = new Entry(name, value);
|
|
||||||
this.entityValues = news;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.redkale.util.Sheet;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@RestService(name = "hello", moduleid = 0, repair = true, ignore = false, comment = "Hello服务模块")
|
@RestService(name = "hello", moduleid = 0, repair = true, ignore = false, comment = "Hello服务模块")
|
||||||
public class HelloService2 implements Service {
|
public class HelloService2 implements Service {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DataSource source;
|
private DataSource source;
|
||||||
|
|||||||
Reference in New Issue
Block a user