forked from Coded/SIPRP
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
54 lines
1.1 KiB
package siprp.database.cayenne.objects;
|
|
|
|
import com.evolute.utils.strings.UnicodeChecker;
|
|
|
|
import siprp.database.cayenne.objects.auto._PostoDeTrabalho;
|
|
|
|
public class PostoDeTrabalho extends _PostoDeTrabalho {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private String description = null;
|
|
|
|
private String convertedDescription = null;
|
|
|
|
@Override
|
|
public String toString()
|
|
{
|
|
return getDescription() == null ? "" : getDescription();
|
|
}
|
|
|
|
@Override
|
|
public String getDescription()
|
|
{
|
|
String currentName = super.getDescription();
|
|
if( description == null || !description.equals( currentName ))
|
|
{
|
|
description = currentName;
|
|
convertedDescription = null;
|
|
}
|
|
return convertName();
|
|
}
|
|
|
|
@Override
|
|
public void setDescription( String nome )
|
|
{
|
|
super.setDescription( nome != null ? UnicodeChecker.parseToUnicode( nome ).replaceAll( "\\\\\\\\", "\\\\" ) : null );
|
|
getDescription();
|
|
}
|
|
|
|
private String convertName()
|
|
{
|
|
if( description == null )
|
|
{
|
|
convertedDescription = null;
|
|
}
|
|
else
|
|
{
|
|
convertedDescription = UnicodeChecker.parseFromUnicode( description );
|
|
}
|
|
return convertedDescription;
|
|
}
|
|
|
|
}
|