索引
- PersistentCategoryKeyValueContent
- ITreeContent
- ItemContent
- InstantaneousTreeContent
- ICodedTreeContent
- IKeyValueContent
- InstantaneousCodedTreeContent
- InstantaneousKeyValueContent
- IGlobalizationContent
- EntityUtil
- EntityStore
- ICategoryTreeContent
- ICategoryKeyValueContent
- ICodedCategoryTreeContent
- EntityJoin
- EntityCapsule
- CacheKeyValueContent
- CacheTreeContent
- ClassContent
- ProxySupport
- CacheCodedTreeContent
- Business
- ValidationSupport
- Validation
- IFinallyAspect
- Intercept
- InvokeContext
- IProxyLoader
- ProxyFactory
- IAspect
- IAroundAspect
- FinallyAspectSupport
- AroundAspectSupport
- AOPUnknownBreak
- AOPBreak
- AOPTransactionBreak
- GridView
- JSONOut
- Galleria
- package-frame
- package-summary
- package-tree
- package-use
- LoginSessionListener
- ApplicationContextListener
- TransactionFilter
- FileUploader.FileUploaderStatus
- FileUploader
- CharacterEncodingFilter
- ImageRedirectFilter
- FileUploader.FileUploaderListener
- PrintWriterDecorator
- IFormatter
- TokenPool
- HttpServletResponseDecorator
- HttpServletRequestDecorator
- ICryptography
- DynamicSecret
- CryptographySupport
- OrmTransactionContext
- OrmPersistenceFactory
- OrmPersistenceCollection
- CryptographyFactory
- OrmContexts
- OrmDatabaseTransaction
- OrmDefinitionContext
- OrmManipulationQueryContext
- OrmPersistence
- IOrmPersistence
- IOrmManipulationQuery
- IOrmTransaction
- Order
- OrmConstant
- IOrmDefinition
- DatabaseHelperSupport
- Entity
- FieldProperty
- Fields
- XMLFormatter
- SetList
- AggregateField
- Condition
- DatabaseHelper
- JSONFormatter
- ISetList
- MapList
- Names
- NameValue
- ServiceRouter
- StreamView
- TextView
- XMLView
- IMapList
- ServiceController
- RouterSupport
- Router
- RedirectView
- MVCRenderException
- MVCNotFoundException
- MVCInternalException
- JSPRouter
- JSPView
- Model
- MVCException
- MVCInstantiationException
- IModel
- IRouter
- IView
- JSONView
- JSPController
- ImageView
- IController
- HTMLView
- ForwardView
- Controller
- MailSender
- RandomGenerator
- ReflectionUtil
- ReservedWord
- QRCode
- LoggerSupport
- ChinesePinYin
- HttpExecuter
- IdCardValidator
- ImageValidateCode
- User32.RECT
- User32.SIZE
- KCLInformation
- IAppender
- Logger
- User32.POINT
- User32
- Identify
- FacadeDirectory
- FacadeIO
- TextReader
- TextWriter
- LocalizationLanguage
- Convert
- Comments
- WinFormInstallationBuilder
- WebFormInstallationBuilder
- PersistentTreeContent
- ServiceBusiness
- TreeContent
- CallingOnly
- CodeBuilder
- PersistentCategoryTreeContent
- PersistentCodedCategoryTreeContent
- PersistentCodedTreeContent
- PersistentGlobalizationContent
- PersistentKeyValueContent
- XMLDocumentEx
- WxOAuthAdapter
- WxPayAdapter
- WxSupport
- KCLConfig
- XMLDocument
- WxOAthAdapter
- WxAdapterSupport
- WxBasicAdapter
- WxMenuAdapter
- WxMessageDispatcher
- IWxReceivedListener
- TreeNode
- TreeLeaf
- Tree
- Train
- IWxEventListener
- ITreeNode
- MapQueue
- DateTime
- Forest
- ICache
- IMapQueue
- ThreadUnsafe
- UnimplementedException
- Untested
- ThreadSafe
- Cache
- MultiThreadUnitTest
- Debugger
- IUnitTest
- UnitTest
- Tested
- UploadView
- TreeView
- Paging
- StringHelper
- RichText
- Video
- Music
- ListView
- Label
- KCLTag
com.knots.kcl.business
Class EntityCapsule
java.lang.Object com.knots.kcl.business.Business com.knots.kcl.business.EntityCapsule
public class EntityCapsule
- extends Business
Entity Capsule Bussiness
Constructor Summary | |
---|---|
EntityCapsule(java.lang.String entityName) |
Method Summary | |
---|---|
int | add(java.lang.String fieldNames, IMapList<java.lang.String,java.lang.Object> entity) Add a entity. |
int | add(java.lang.String fieldNames, java.lang.Object... fieldValues) Add a entity. |
int | count() Count entity. |
int | countByParam(java.lang.String paramNames, java.lang.Object... paramValues) Count entity by parameters. |
boolean | findById(int entityId) Find an entity by id. |
boolean | findByParam(java.lang.String paramNames, java.lang.Object... paramValues) Find an entity by parameters. |
Entity[] | getAll() Get all entities. |
Entity[] | getAll(java.lang.String fields) Get all entities. |
Entity[] | getAll(java.lang.String fields, java.lang.Integer start, java.lang.Integer length) Get all entities. |
Entity[] | getAll(java.lang.String fields, java.lang.String orders, java.lang.Integer start, java.lang.Integer length) Get all entities. |
Entity | getById(int entityId) Get an entity by id. |
Entity | getById(int entityId, java.lang.String fields) Get an entity by id. |
Entity[] | getByParam(java.lang.String fields, java.lang.Integer start, java.lang.Integer length, java.lang.String paramNames, java.lang.Object... paramValues) Get entities by parameters. |
Entity[] | getByParam(java.lang.String paramNames, java.lang.Object... paramValues) Get entities by parameters. |
Entity[] | getByParam(java.lang.String fields, java.lang.String orders, java.lang.Integer start, java.lang.Integer length, java.lang.String paramNames, java.lang.Object... paramValues) Get entities by parameters. |
java.lang.String | getEntityName() |
void | kill(int id) Delete a entity. |
Entity | peekByParam(java.lang.String fields, java.lang.String paramNames, java.lang.Object... paramValues) Get first entity by parameters. |
java.lang.Object | peekFieldById(java.lang.String field, int id) Get specified field of first entity by id. |
java.lang.Object | peekFieldByParam(java.lang.String field, java.lang.String paramNames, java.lang.Object... paramValues) Get specified field of first entity by parameters. |
int | peekIdByParam(java.lang.String paramNames, java.lang.Object... paramValues) Get first entity id by parameters. |
int | set(int id, java.lang.String fieldNames, IMapList<java.lang.String,java.lang.Object> entity) Save a entity. |
int | set(int id, java.lang.String fieldNames, java.lang.Object... fieldValues) Save a entity. |
void | setEntityName(java.lang.String entityName) |
Methods inherited from class com.knots.kcl.business.Business |
---|
getPersistence |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
EntityCapsule
public EntityCapsule(java.lang.String entityName)
- Parameters:
entityName
- name of entity
Method Detail |
---|
getEntityName
public java.lang.String getEntityName()
setEntityName
public void setEntityName(java.lang.String entityName)
kill
public void kill(int id) throws java.lang.Exception
- Delete a entity.
- Parameters:
id
- id of entity- Throws:
java.lang.Exception
add
public int add(java.lang.String fieldNames, java.lang.Object... fieldValues) throws java.lang.Exception
- Add a entity.
- Parameters:
fieldNames
- field names splited by commafieldValues
- object array of field values- Returns:
- identifier of new entity
- Throws:
java.lang.Exception
add
public int add(java.lang.String fieldNames, IMapList<java.lang.String,java.lang.Object> entity) throws java.lang.Exception
- Add a entity.
- Parameters:
fieldNames
- field names splited by commaentity
- entity wants to add- Returns:
- identifier of new entity
- Throws:
java.lang.Exception
set
public int set(int id, java.lang.String fieldNames, java.lang.Object... fieldValues) throws java.lang.Exception
- Save a entity.
- Parameters:
id
- id of entityfieldNames
- field names splited by commafieldValues
- object array of field values- Returns:
- id of entity
- Throws:
java.lang.Exception
set
public int set(int id, java.lang.String fieldNames, IMapList<java.lang.String,java.lang.Object> entity) throws java.lang.Exception
- Save a entity.
- Parameters:
id
- id of entityfieldNames
- field names splited by commaentity
- entity wants to set- Returns:
- id of entity
- Throws:
java.lang.Exception
getById
public Entity getById(int entityId) throws java.lang.Exception
- Get an entity by id.
- Parameters:
entityId
- id of entity- Throws:
java.lang.Exception
getById
public Entity getById(int entityId, java.lang.String fields) throws java.lang.Exception
- Get an entity by id.
- Parameters:
entityId
- id of entityfields
- fields wants to return splited by comma- Throws:
java.lang.Exception
getByParam
public Entity[] getByParam(java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Get entities by parameters.
- Parameters:
paramNames
- parameter field names splited by commaparamValues
- value object array of parameter values- Throws:
java.lang.Exception
getByParam
public Entity[] getByParam(java.lang.String fields, java.lang.Integer start, java.lang.Integer length, java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Get entities by parameters.
- Parameters:
fields
- fields wants to return splited by commastart
- start of resultslength
- length of results, null or number >= 0.paramNames
- parameter names splited by commaparamValues
- object array of parameter values- Throws:
java.lang.Exception
getByParam
public Entity[] getByParam(java.lang.String fields, java.lang.String orders, java.lang.Integer start, java.lang.Integer length, java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Get entities by parameters.
- Parameters:
fields
- fields wants to return splited by commastart
- start of resultslength
- length of results, null or number >= 0.orders
- orders of resultsparamNames
- parameter names splited by commaparamValues
- object array of parameter values- Throws:
java.lang.Exception
getAll
public Entity[] getAll() throws java.lang.Exception
- Get all entities.
- Throws:
java.lang.Exception
getAll
public Entity[] getAll(java.lang.String fields) throws java.lang.Exception
- Get all entities.
- Parameters:
fields
- fields wants to return- Throws:
java.lang.Exception
getAll
public Entity[] getAll(java.lang.String fields, java.lang.Integer start, java.lang.Integer length) throws java.lang.Exception
- Get all entities.
- Parameters:
fields
- fields wants to returnstart
- start of resultslength
- length of results, null or number >= 0.- Throws:
java.lang.Exception
getAll
public Entity[] getAll(java.lang.String fields, java.lang.String orders, java.lang.Integer start, java.lang.Integer length) throws java.lang.Exception
- Get all entities.
- Parameters:
fields
- fields wants to returnstart
- start of results, null or number >= 0.length
- length of results- Throws:
java.lang.Exception
peekByParam
public Entity peekByParam(java.lang.String fields, java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Get first entity by parameters.
- Parameters:
fields
- fields wants to returnparamNames
- parameter names splited by commaparamValues
- object array of parameter values- Throws:
java.lang.Exception
peekIdByParam
public int peekIdByParam(java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Get first entity id by parameters.
- Parameters:
paramNames
- parameter names splited by commaparamValues
- object array of parameter values- Throws:
java.lang.Exception
peekFieldById
public java.lang.Object peekFieldById(java.lang.String field, int id) throws java.lang.Exception
- Get specified field of first entity by id.
- Parameters:
field
- field wants to returnid
- id of entity- Throws:
java.lang.Exception
peekFieldByParam
public java.lang.Object peekFieldByParam(java.lang.String field, java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Get specified field of first entity by parameters.
- Parameters:
field
- field wants to returnparamNames
- parameter names splited by commaparamValues
- object array of parameter values- Throws:
java.lang.Exception
findById
public boolean findById(int entityId) throws java.lang.Exception
- Find an entity by id.
- Parameters:
entityId
- id of entity- Throws:
java.lang.Exception
findByParam
public boolean findByParam(java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Find an entity by parameters.
- Parameters:
paramNames
- parameter names splited by commaparamValues
- object array of parameter values- Throws:
java.lang.Exception
count
public int count() throws java.lang.Exception
- Count entity.
- Throws:
java.lang.Exception
countByParam
public int countByParam(java.lang.String paramNames, java.lang.Object... paramValues) throws java.lang.Exception
- Count entity by parameters.
- Parameters:
paramNames
- parameter names splited by commaparamValues
- object array of parameter values- Throws:
java.lang.Exception