|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--canguru.descriptor.Descriptor
Classe com definições para persistência de determinada entidade
Field Summary | |
private java.util.Map |
elements
|
private java.util.Map |
entityDefinition
|
private java.lang.String |
entityName
|
private Filtered |
filtered
|
private ProxyDB |
proxyDB
|
Constructor Summary | |
Descriptor(java.lang.String entityName)
Cria um descriptor definindo a entidade a ser tratada |
Method Summary | |
void |
addAttribute(java.lang.Long elementId,
java.lang.String attributeName,
java.lang.Long attributeId,
java.lang.Object attributeValue)
Adiciona um atributo a um elemento |
void |
addAttributeDefinition(java.lang.String attributeName,
java.lang.Class javaType)
Adiciona um atributo ao Map com a definição dos atributos a serem salvos |
void |
addElement(java.lang.Long id)
Adiciona um elemento ao descriptor |
void |
addFilter(java.lang.String attributeName,
java.lang.Object attributeValue)
|
void |
addSerializedForm(java.lang.Long elementId,
byte[] serializedForm)
Registra forma serializada do elemento |
AttributeType |
getAttributeType(java.lang.String attributeName)
Retorna o tipo de um atributo |
Element |
getElement(java.lang.Long id)
Retorna o elemento com o id informado |
java.util.Map |
getElements()
Retorna o Map com os elementos a serem salvos no formato (idElemento, elemento) |
java.util.Map |
getEntityDefinition()
Retorna o Map com a definição dos atributos a serem salvos no formato (nomeAtributo, tipoAtributo) |
java.lang.String |
getEntityName()
Retorna o nome da entidade a ser tratada |
Filtered |
getFiltered()
|
ProxyDB |
getProxyDB()
|
void |
load()
Carrega todos os elementos no banco de dados no Map de elementos |
void |
loadFiltered()
|
void |
removeAllElements()
Remove todos os elementos do descriptor |
void |
removeFiltered()
|
void |
save()
Salva todos os elementos no banco de dados e limpa Map de elementos |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Map elements
private java.util.Map entityDefinition
private java.lang.String entityName
private Filtered filtered
private ProxyDB proxyDB
Constructor Detail |
public Descriptor(java.lang.String entityName)
entityName
- nome da entidadeMethod Detail |
public void addAttribute(java.lang.Long elementId, java.lang.String attributeName, java.lang.Long attributeId, java.lang.Object attributeValue) throws ElementNotFoundException, AttributeDefinitionNotFoundException, InvalidNameException, InvalidAttributeException
elementId
- id do elemento
ElementNotFoundException
AttributeDefinitionNotFoundException
InvalidNameException
InvalidAttributeException
public void addAttributeDefinition(java.lang.String attributeName, java.lang.Class javaType) throws InvalidNameException, InvalidOperationException
Map
com a definição dos atributos a serem salvos
attributeName
- Nome do atributojavaType
- Classe java do atributo
InvalidNameException
InvalidOperationException
public void addElement(java.lang.Long id)
public void addFilter(java.lang.String attributeName, java.lang.Object attributeValue) throws AttributeDefinitionNotFoundException, InvalidNameException, InvalidAttributeException
AttributeDefinitionNotFoundException
InvalidNameException
InvalidAttributeException
public void addSerializedForm(java.lang.Long elementId, byte[] serializedForm) throws ElementNotFoundException
elementId
- id do elementoserializedForm
- forma serializada do elemento
ElementNotFoundException
public AttributeType getAttributeType(java.lang.String attributeName) throws AttributeNotFoundException
attributeName
- Nome do atributo
AttributeNotFoundException
public Element getElement(java.lang.Long id) throws ElementNotFoundException
ElementNotFoundException
public java.util.Map getElements()
Map
com os elementos a serem salvos no formato (idElemento, elemento)
public java.util.Map getEntityDefinition()
Map
com a definição dos atributos a serem salvos no formato (nomeAtributo, tipoAtributo)
public java.lang.String getEntityName()
public Filtered getFiltered()
public ProxyDB getProxyDB() throws java.lang.ClassNotFoundException, java.sql.SQLException, java.io.IOException
java.lang.ClassNotFoundException
java.sql.SQLException
java.io.IOException
public void load() throws java.lang.ClassNotFoundException, java.sql.SQLException, java.io.IOException
Map
de elementos
java.lang.ClassNotFoundException
java.sql.SQLException
java.io.IOException
public void loadFiltered() throws java.lang.ClassNotFoundException, java.io.IOException, java.sql.SQLException, ElementNotFoundException
java.lang.ClassNotFoundException
java.io.IOException
java.sql.SQLException
ElementNotFoundException
public void removeAllElements()
public void removeFiltered()
public void save() throws java.lang.ClassNotFoundException, java.sql.SQLException, java.io.IOException
Map
de elementos
java.lang.ClassNotFoundException
java.sql.SQLException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |