<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR">
	<id>http://wiki.biserp.com.br/index.php?action=history&amp;feed=atom&amp;title=BISOrderBy</id>
	<title>BISOrderBy - Histórico de revisão</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.biserp.com.br/index.php?action=history&amp;feed=atom&amp;title=BISOrderBy"/>
	<link rel="alternate" type="text/html" href="http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;action=history"/>
	<updated>2026-04-09T00:26:11Z</updated>
	<subtitle>Histórico de revisões para esta página neste wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=600&amp;oldid=prev</id>
		<title>Rodrigogml em 17h26min de 7 de setembro de 2015</title>
		<link rel="alternate" type="text/html" href="http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=600&amp;oldid=prev"/>
		<updated>2015-09-07T17:26:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pt-BR&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Edição anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Edição das 17h26min de 7 de setembro de 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot;&gt;Linha 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por duas colunas&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por duas colunas&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(AbbreviationVO_.VO.priority(), false).addOrderbyItem(AbbreviationVO_.occurrence());&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(AbbreviationVO_.VO.priority(), false).addOrderbyItem(AbbreviationVO_&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.VO&lt;/ins&gt;.occurrence());&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rodrigogml</name></author>
	</entry>
	<entry>
		<id>http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=599&amp;oldid=prev</id>
		<title>Rodrigogml em 17h21min de 7 de setembro de 2015</title>
		<link rel="alternate" type="text/html" href="http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=599&amp;oldid=prev"/>
		<updated>2015-09-07T17:21:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pt-BR&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Edição anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Edição das 17h21min de 7 de setembro de 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;Linha 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java5&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java5&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por uma coluna&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por uma coluna&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationMO&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ORDERBY_PRIORITY&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationVO_&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;VO.priority()&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por uma coluna de for descendente&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por uma coluna de for descendente&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationMO&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ORDERBY_PRIORITY&lt;/del&gt;, false);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationVO_&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;VO.priority()&lt;/ins&gt;, false);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por duas colunas&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//Ordenando por duas colunas&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationMO&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ORDERBY_PRIORITY&lt;/del&gt;, false).addOrderbyItem(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationMO&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ORDERBY_OCCURENCE&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;BISOrderBy.getBISOrderbyInstance(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationVO_&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;VO.priority()&lt;/ins&gt;, false).addOrderbyItem(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;AbbreviationVO_&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;occurrence()&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rodrigogml</name></author>
	</entry>
	<entry>
		<id>http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=598&amp;oldid=prev</id>
		<title>Rodrigogml em 17h20min de 7 de setembro de 2015</title>
		<link rel="alternate" type="text/html" href="http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=598&amp;oldid=prev"/>
		<updated>2015-09-07T17:20:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pt-BR&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Edição anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Edição das 17h20min de 7 de setembro de 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Linha 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;O BISOrderBy é o objeto usado em conjunto com os MOs pela &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;camada de persistência &lt;/del&gt;do &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BISCore &lt;/del&gt;para definir a ordem que os objetos devem ser retornados ao utilizarmos os métodos de find. Para criar o BISOrderBy é possível de duas maneiras: instanciando o objeto como qualquer outro, ou utilizando os métodos estáticos &quot;getBISOrderbyInstance()&quot;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;O BISOrderBy é o objeto usado em conjunto com os MOs pela &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[BISDAO]] &lt;/ins&gt;do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BISFrameWork &lt;/ins&gt;para definir a ordem que os objetos devem ser retornados ao utilizarmos os métodos de find. Para criar o BISOrderBy é possível de duas maneiras: instanciando o objeto como qualquer outro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(sintaxe &quot;new BISOrderBy(...)&quot;)&lt;/ins&gt;, ou utilizando os métodos estáticos &quot;getBISOrderbyInstance()&quot;. Em ambos os casos é possível passar dois atributos: coluna a ordenar e ascendência/descendência do campo. Por padrão, se passada só o nome da coluna, a ordem será ascendente. O nome da coluna a ser passada é o mesmo nome do atributo do VO.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Em ambos os casos é possível passar dois atributos: coluna a ordenar e ascendência / descendência do campo. Por padrão, se passada só o nome da coluna, a ordem será ascendente. O nome da coluna a ser passada é o mesmo nome do atributo do VO.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por exemplo, se temos um ClientVO, e queremos ordenar pelo atributo &quot;name&quot;, devemos criar o BISOrderBy passando a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;string &lt;/del&gt;&quot;name&quot; como parâmetro. Se desejarmos que a ordem da lista seja de Z para A, devemos passar o segundo atributo como &quot;false&quot;. Como o valor padrão é sempre true na ordem da lista, não faz sentido passar o segundo atributo para obter uma lista ascendente.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por exemplo, se temos um ClientVO, e queremos ordenar pelo atributo &quot;name&quot;, devemos criar o BISOrderBy passando a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;String &lt;/ins&gt;&quot;name&quot; como parâmetro. Se desejarmos que a ordem da lista seja de Z para A, devemos passar o segundo atributo como &quot;false&quot;. Como o valor padrão é sempre true na ordem da lista, não faz sentido passar o segundo atributo para obter uma lista ascendente.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;É possível organizar uma lista por um atributo que esteja em um sub VO. Por exemplo, imaginando que nosso ClientVO tenha um atributo &amp;quot;address&amp;quot; que carregue um AddressVO, e este tenha um atributo para o nome da rua chamado &amp;quot;street&amp;quot;. Para ordenar a lista de clientes por nome da rua, devemos criar um BISOrderBy passando como atributo a string &amp;quot;address.street&amp;quot;. Lembrando que o find a ser utilizado é de Client, e não de address.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;É possível organizar uma lista por um atributo que esteja em um sub VO. Por exemplo, imaginando que nosso ClientVO tenha um atributo &amp;quot;address&amp;quot; que carregue um AddressVO, e este tenha um atributo para o nome da rua chamado &amp;quot;street&amp;quot;. Para ordenar a lista de clientes por nome da rua, devemos criar um BISOrderBy passando como atributo a string &amp;quot;address.street&amp;quot;. Lembrando que o find a ser utilizado é de Client, e não de address.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{nota|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Criando Constantes&lt;/del&gt;|Um dos possíveis problemas de se passar o nome do atributo como &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;string &lt;/del&gt;é um futuro refactor ou alterações do código que venham a alterar o nome da coluna/atributo do VO. Quando isso ocorre, mesmo mudando os métodos Get e Set o nome do atributo passado na String não é validado pelo builder e gerará erro de RunTime já que o atributo não será encontrado no VO.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{nota|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Usando o MetaObjects&lt;/ins&gt;|Um dos possíveis problemas de se passar o nome do atributo como &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;String &lt;/ins&gt;é um futuro refactor ou alterações do código que venham a alterar o nome da coluna/atributo do VO. Quando isso ocorre, mesmo mudando os métodos Get e Set o nome do atributo passado na String não é validado pelo builder e gerará erro de RunTime já que o atributo não será encontrado no VO.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para evitar esse tipo de problema, recomendamos que os atributos &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;usados comumente para ordenação da lista &lt;/del&gt;sejam &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;colocados como constantes no MO. Desta forma ficam concentrados nas classes de VO as string de ordenação&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mesmo &lt;/del&gt;assim, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nos casos de atributos em cadeia, como &lt;/del&gt;o &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nosso &quot;address&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;street&quot; não estará visível no objeto AddressMO, e sim no ClientMO.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Por isso a melhor maneira é evitar &lt;/del&gt;o &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;refactor de nomes de atributos, &lt;/del&gt;e &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;como evitar? Pensar bem antes de defini-los. Se não houver hipóteses e houver mesmo a necessidade de um refactor, lembre-se sempre de fazer pesquisar no código por texto com o nome do atributo&lt;/del&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para evitar esse tipo de problema, recomendamos que os atributos &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;passados no OrderBy &lt;/ins&gt;sejam &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;extraídos do MetaObject ([[BISVO_]])&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Permitindo &lt;/ins&gt;assim &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;que futuras alterações sejam detectadas logo na compilação do sistema&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;não só durante &lt;/ins&gt;o &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uso&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Principalmente &lt;/ins&gt;o &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uso já em homologação &lt;/ins&gt;e &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pelo cliente&lt;/ins&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rodrigogml</name></author>
	</entry>
	<entry>
		<id>http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=597&amp;oldid=prev</id>
		<title>Rodrigogml em 17h10min de 7 de setembro de 2015</title>
		<link rel="alternate" type="text/html" href="http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=597&amp;oldid=prev"/>
		<updated>2015-09-07T17:10:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pt-BR&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Edição anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Edição das 17h10min de 7 de setembro de 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Linha 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por exemplo, se temos um ClientVO, e queremos ordenar pelo atributo &amp;quot;name&amp;quot;, devemos criar o BISOrderBy passando a string &amp;quot;name&amp;quot; como parâmetro. Se desejarmos que a ordem da lista seja de Z para A, devemos passar o segundo atributo como &amp;quot;false&amp;quot;. Como o valor padrão é sempre true na ordem da lista, não faz sentido passar o segundo atributo para obter uma lista ascendente.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por exemplo, se temos um ClientVO, e queremos ordenar pelo atributo &amp;quot;name&amp;quot;, devemos criar o BISOrderBy passando a string &amp;quot;name&amp;quot; como parâmetro. Se desejarmos que a ordem da lista seja de Z para A, devemos passar o segundo atributo como &amp;quot;false&amp;quot;. Como o valor padrão é sempre true na ordem da lista, não faz sentido passar o segundo atributo para obter uma lista ascendente.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;É possível organizar uma lista por um atributo que esteja em um sub VO. Por exemplo, imaginando que nosso ClientVO tenha um atributo &amp;quot;address&amp;quot; que carregue um AddressVO, e este tenha um atributo para o nome da rua chamado &amp;quot;street&amp;quot;. Para ordenar a lista de clientes por nome da rua, devemos criar um BISOrderBy passando como atributo a string &amp;quot;address.street&amp;quot;. Lembrando que o find a ser utilizado é de Client, e não de address.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;É possível organizar uma lista por um atributo que esteja em um sub VO. Por exemplo, imaginando que nosso ClientVO tenha um atributo &amp;quot;address&amp;quot; que carregue um AddressVO, e este tenha um atributo para o nome da rua chamado &amp;quot;street&amp;quot;. Para ordenar a lista de clientes por nome da rua, devemos criar um BISOrderBy passando como atributo a string &amp;quot;address.street&amp;quot;. Lembrando que o find a ser utilizado é de Client, e não de address.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{nota|Criando Constantes|Um dos possíveis problemas de se passar o nome do atributo como string é um futuro refactor ou alterações do código que venham a alterar o nome da coluna/atributo do VO. Quando isso ocorre, mesmo mudando os métodos Get e Set o nome do atributo passado na String não é validado pelo builder e gerará erro de RunTime já que o atributo não será encontrado no VO.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{nota|Criando Constantes|Um dos possíveis problemas de se passar o nome do atributo como string é um futuro refactor ou alterações do código que venham a alterar o nome da coluna/atributo do VO. Quando isso ocorre, mesmo mudando os métodos Get e Set o nome do atributo passado na String não é validado pelo builder e gerará erro de RunTime já que o atributo não será encontrado no VO.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para evitar esse tipo de problema, recomendamos que os atributos usados comumente para ordenação da lista sejam colocados como constantes no MO. Desta forma ficam concentrados nas classes de VO as string de ordenação. Mesmo assim, nos casos de atributos em cadeia, como o nosso &amp;quot;address.street&amp;quot; não estará visível no objeto AddressMO, e sim no ClientMO.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para evitar esse tipo de problema, recomendamos que os atributos usados comumente para ordenação da lista sejam colocados como constantes no MO. Desta forma ficam concentrados nas classes de VO as string de ordenação. Mesmo assim, nos casos de atributos em cadeia, como o nosso &amp;quot;address.street&amp;quot; não estará visível no objeto AddressMO, e sim no ClientMO.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por isso a melhor maneira é evitar o refactor de nomes de atributos, e como evitar? Pensar bem antes de defini-los. Se não houver hipóteses e houver mesmo a necessidade de um refactor, lembre-se sempre de fazer pesquisar no código por texto com o nome do atributo.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por isso a melhor maneira é evitar o refactor de nomes de atributos, e como evitar? Pensar bem antes de defini-los. Se não houver hipóteses e houver mesmo a necessidade de um refactor, lembre-se sempre de fazer pesquisar no código por texto com o nome do atributo.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para ordenar por múltiplas colunas, basta chamar os métodos &amp;quot;addOrderbyItem()&amp;quot; e passar os mesmos atributos citados acima, ou um BISOrderBy completo. A ordem em que estes são acrescentados define a prioridade de cada coluna, ou seja, a segunda coluna só será utilizada se houver empate na primeira, a terceira só será usada de houver empate na primeira e segunda, e assim por diante.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para ordenar por múltiplas colunas, basta chamar os métodos &amp;quot;addOrderbyItem()&amp;quot; e passar os mesmos atributos citados acima, ou um BISOrderBy completo. A ordem em que estes são acrescentados define a prioridade de cada coluna, ou seja, a segunda coluna só será utilizada se houver empate na primeira, a terceira só será usada de houver empate na primeira e segunda, e assim por diante.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{java|Criando BISOrderBy|&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{java|Criando BISOrderBy|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rodrigogml</name></author>
	</entry>
	<entry>
		<id>http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=595&amp;oldid=prev</id>
		<title>Rodrigogml: Criou página com &#039;O BISOrderBy é o objeto usado em conjunto com os MOs pela camada de persistência do BISCore para definir a ordem que os objetos devem ser retornados ao utilizarmos os métod...&#039;</title>
		<link rel="alternate" type="text/html" href="http://wiki.biserp.com.br/index.php?title=BISOrderBy&amp;diff=595&amp;oldid=prev"/>
		<updated>2015-09-07T16:58:15Z</updated>

		<summary type="html">&lt;p&gt;Criou página com &amp;#039;O BISOrderBy é o objeto usado em conjunto com os MOs pela camada de persistência do BISCore para definir a ordem que os objetos devem ser retornados ao utilizarmos os métod...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;O BISOrderBy é o objeto usado em conjunto com os MOs pela camada de persistência do BISCore para definir a ordem que os objetos devem ser retornados ao utilizarmos os métodos de find. Para criar o BISOrderBy é possível de duas maneiras: instanciando o objeto como qualquer outro, ou utilizando os métodos estáticos &amp;quot;getBISOrderbyInstance()&amp;quot;.&lt;br /&gt;
Em ambos os casos é possível passar dois atributos: coluna a ordenar e ascendência / descendência do campo. Por padrão, se passada só o nome da coluna, a ordem será ascendente. O nome da coluna a ser passada é o mesmo nome do atributo do VO.&lt;br /&gt;
&lt;br /&gt;
Por exemplo, se temos um ClientVO, e queremos ordenar pelo atributo &amp;quot;name&amp;quot;, devemos criar o BISOrderBy passando a string &amp;quot;name&amp;quot; como parâmetro. Se desejarmos que a ordem da lista seja de Z para A, devemos passar o segundo atributo como &amp;quot;false&amp;quot;. Como o valor padrão é sempre true na ordem da lista, não faz sentido passar o segundo atributo para obter uma lista ascendente.&lt;br /&gt;
É possível organizar uma lista por um atributo que esteja em um sub VO. Por exemplo, imaginando que nosso ClientVO tenha um atributo &amp;quot;address&amp;quot; que carregue um AddressVO, e este tenha um atributo para o nome da rua chamado &amp;quot;street&amp;quot;. Para ordenar a lista de clientes por nome da rua, devemos criar um BISOrderBy passando como atributo a string &amp;quot;address.street&amp;quot;. Lembrando que o find a ser utilizado é de Client, e não de address.&lt;br /&gt;
&lt;br /&gt;
{{nota|Criando Constantes|Um dos possíveis problemas de se passar o nome do atributo como string é um futuro refactor ou alterações do código que venham a alterar o nome da coluna/atributo do VO. Quando isso ocorre, mesmo mudando os métodos Get e Set o nome do atributo passado na String não é validado pelo builder e gerará erro de RunTime já que o atributo não será encontrado no VO.&lt;br /&gt;
Para evitar esse tipo de problema, recomendamos que os atributos usados comumente para ordenação da lista sejam colocados como constantes no MO. Desta forma ficam concentrados nas classes de VO as string de ordenação. Mesmo assim, nos casos de atributos em cadeia, como o nosso &amp;quot;address.street&amp;quot; não estará visível no objeto AddressMO, e sim no ClientMO.&lt;br /&gt;
Por isso a melhor maneira é evitar o refactor de nomes de atributos, e como evitar? Pensar bem antes de defini-los. Se não houver hipóteses e houver mesmo a necessidade de um refactor, lembre-se sempre de fazer pesquisar no código por texto com o nome do atributo.}}&lt;br /&gt;
&lt;br /&gt;
Para ordenar por múltiplas colunas, basta chamar os métodos &amp;quot;addOrderbyItem()&amp;quot; e passar os mesmos atributos citados acima, ou um BISOrderBy completo. A ordem em que estes são acrescentados define a prioridade de cada coluna, ou seja, a segunda coluna só será utilizada se houver empate na primeira, a terceira só será usada de houver empate na primeira e segunda, e assim por diante.&lt;br /&gt;
&lt;br /&gt;
{{java|Criando BISOrderBy|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java5&amp;quot;&amp;gt;&lt;br /&gt;
//Ordenando por uma coluna&lt;br /&gt;
BISOrderBy.getBISOrderbyInstance(AbbreviationMO.ORDERBY_PRIORITY);&lt;br /&gt;
&lt;br /&gt;
//Ordenando por uma coluna de for descendente&lt;br /&gt;
BISOrderBy.getBISOrderbyInstance(AbbreviationMO.ORDERBY_PRIORITY, false);&lt;br /&gt;
&lt;br /&gt;
//Ordenando por duas colunas&lt;br /&gt;
BISOrderBy.getBISOrderbyInstance(AbbreviationMO.ORDERBY_PRIORITY, false).addOrderbyItem(AbbreviationMO.ORDERBY_OCCURENCE);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;/div&gt;</summary>
		<author><name>Rodrigogml</name></author>
	</entry>
</feed>