mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-09 16:43:17 +00:00
#115 - Mapping - Add support for @ElementCollection enhancement
Add element collection L2 cache support
This commit is contained in:
1 parent
07946cd505
commit
acd5578d8a
52 files changed
+734
-135
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package io.ebeaninternal.api.json;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.bean.PersistenceContext;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public interface SpiJsonReader {
|
||||
|
||||
PersistenceContext getPersistenceContext();
|
||||
|
||||
SpiJsonReader forJson(JsonParser moreJson, boolean resetContext);
|
||||
|
||||
<T> void persistenceContextPut(Object beanId, T currentBean);
|
||||
|
||||
Object persistenceContextPutIfAbsent(Object id, EntityBean bean, BeanDescriptor<?> beanDesc);
|
||||
|
||||
ObjectMapper getObjectMapper();
|
||||
|
||||
JsonParser getParser();
|
||||
|
||||
JsonToken nextToken() throws IOException;
|
||||
|
||||
void pushPath(String path);
|
||||
|
||||
void popPath();
|
||||
|
||||
void beanVisitor(Object bean, Map<String, Object> unmappedProperties);
|
||||
|
||||
Object readValueUsingObjectMapper(Class<?> propertyType) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package io.ebeaninternal.api.json;
|
||||
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.text.json.JsonWriter;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Internal API extensions for JSON writing of Bean properties.
|
||||
*/
|
||||
public interface SpiJsonWriter extends JsonWriter {
|
||||
|
||||
/**
|
||||
* Flush the buffer.
|
||||
*/
|
||||
void flush() throws IOException;
|
||||
|
||||
/**
|
||||
* Return true if the value is a parent bean.
|
||||
*/
|
||||
boolean isParentBean(Object value);
|
||||
|
||||
/**
|
||||
* Start an assoc one path.
|
||||
*/
|
||||
void beginAssocOne(String name, EntityBean bean);
|
||||
|
||||
/**
|
||||
* End an assoc one path.
|
||||
*/
|
||||
void endAssocOne();
|
||||
|
||||
/**
|
||||
* Return true if the many property should be included.
|
||||
*/
|
||||
Boolean includeMany(String name);
|
||||
|
||||
/**
|
||||
* Push the parent bean of a ToMany.
|
||||
*/
|
||||
void pushParentBeanMany(EntityBean bean);
|
||||
|
||||
/**
|
||||
* Pop the parent of a ToMany.
|
||||
*/
|
||||
void popParentBeanMany();
|
||||
|
||||
/**
|
||||
* Write the collection.
|
||||
*/
|
||||
void toJson(String name, Collection<?> collection);
|
||||
|
||||
/**
|
||||
* Start a Many.
|
||||
*/
|
||||
void beginAssocMany(String name);
|
||||
|
||||
/**
|
||||
* End a Many.
|
||||
*/
|
||||
void endAssocMany();
|
||||
|
||||
/**
|
||||
* Write value using underlying Jaskson object mapper if available.
|
||||
*/
|
||||
void writeValueUsingObjectMapper(String name, Object value);
|
||||
|
||||
/**
|
||||
* Write the bean properties.
|
||||
*/
|
||||
<T> void writeBean(BeanDescriptor<T> desc, EntityBean bean);
|
||||
}
|
||||
Reference in new issue
Block a user