Skip to content

Commit

Permalink
KAA-1566: small fix. All modified length values rewrote to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
vchizhevsky committed Nov 18, 2016
1 parent f801043 commit 3e50053
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
Expand Up @@ -82,6 +82,8 @@ public class DaoConstants {

public static final String OPTIMISTIC_LOCK_PROPERTY = "OPT_LOCK";

public static final int DESCRIPTION_ROW_LENGTH = 1024;

/**
* Common constants.
*/
Expand Down
Expand Up @@ -26,6 +26,7 @@
import static org.kaaproject.kaa.server.common.dao.DaoConstants.BASE_SCHEMA_NAME;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.BASE_SCHEMA_TABLE_NAME;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.BASE_SCHEMA_VERSION;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.DESCRIPTION_ROW_LENGTH;
import static org.kaaproject.kaa.server.common.dao.model.sql.ModelUtils.getLongId;

import org.hibernate.annotations.OnDelete;
Expand Down Expand Up @@ -57,7 +58,7 @@ public abstract class BaseSchema<T extends BaseSchemaDto> extends GenericModel<T
@Column(name = BASE_SCHEMA_NAME)
protected String name;

@Column(name = BASE_SCHEMA_DESCRIPTION, length = 1024)
@Column(name = BASE_SCHEMA_DESCRIPTION, length = DESCRIPTION_ROW_LENGTH)
protected String description;

@Column(name = BASE_SCHEMA_CREATED_USERNAME)
Expand Down
Expand Up @@ -16,6 +16,7 @@

package org.kaaproject.kaa.server.common.dao.model.sql;

import static org.kaaproject.kaa.server.common.dao.DaoConstants.DESCRIPTION_ROW_LENGTH;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.ENDPOINT_GROUP_APPLICATION_ID;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.ENDPOINT_GROUP_CREATED_TIME;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.ENDPOINT_GROUP_CREATED_USERNAME;
Expand Down Expand Up @@ -66,7 +67,7 @@ public class EndpointGroup extends GenericModel<EndpointGroupDto> implements Ser
@Column(name = ENDPOINT_GROUP_ENDPOINT_COUNT)
private long endpointCount;

@Column(name = ENDPOINT_GROUP_DESCRIPTION, length = 1024)
@Column(name = ENDPOINT_GROUP_DESCRIPTION, length = DESCRIPTION_ROW_LENGTH)
private String description;

@Column(name = ENDPOINT_GROUP_CREATED_USERNAME)
Expand Down
Expand Up @@ -16,6 +16,7 @@

package org.kaaproject.kaa.server.common.dao.model.sql;

import static org.kaaproject.kaa.server.common.dao.DaoConstants.DESCRIPTION_ROW_LENGTH;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.EVENT_CLASS_FAMILY_CLASS_NAME;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.EVENT_CLASS_FAMILY_CREATED_TIME;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.EVENT_CLASS_FAMILY_CREATED_USERNAME;
Expand Down Expand Up @@ -46,7 +47,7 @@
public class EventClassFamily extends GenericModel<EventClassFamilyDto> {

private static final long serialVersionUID = 3766947955702551264L;
@Column(name = EVENT_CLASS_FAMILY_DESCRIPTION, length = 1024)
@Column(name = EVENT_CLASS_FAMILY_DESCRIPTION, length = DESCRIPTION_ROW_LENGTH)
protected String description;
@Column(name = EVENT_CLASS_FAMILY_CREATED_USERNAME)
protected String createdUsername;
Expand Down
Expand Up @@ -16,6 +16,7 @@

package org.kaaproject.kaa.server.common.dao.model.sql;

import static org.kaaproject.kaa.server.common.dao.DaoConstants.DESCRIPTION_ROW_LENGTH;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.PLUGIN_APPLICATION_ID;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.PLUGIN_CLASS_NAME;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.PLUGIN_CREATED_TIME;
Expand Down Expand Up @@ -55,7 +56,7 @@ public abstract class Plugin<T extends PluginDto> extends GenericModel<T> implem
protected Application application;
@Column(name = PLUGIN_NAME)
private String name;
@Column(name = PLUGIN_DESCRIPTION, length = 1024)
@Column(name = PLUGIN_DESCRIPTION, length = DESCRIPTION_ROW_LENGTH)
private String description;
@Column(name = PLUGIN_CREATED_USERNAME)
private String createdUsername;
Expand Down
Expand Up @@ -16,6 +16,7 @@

package org.kaaproject.kaa.server.common.dao.model.sql;

import static org.kaaproject.kaa.server.common.dao.DaoConstants.DESCRIPTION_ROW_LENGTH;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.ENDPOINT_GROUP_APPLICATION_ID;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.ENDPOINT_GROUP_TOPICS_ENDPOINT_GROUP_ID;
import static org.kaaproject.kaa.server.common.dao.DaoConstants.ENDPOINT_GROUP_TOPICS_TABLE_NAME;
Expand Down Expand Up @@ -58,7 +59,7 @@
public class Topic extends GenericModel<TopicDto> implements Serializable {

private static final long serialVersionUID = -5617352698933455002L;
@Column(name = TOPIC_DESCRIPTION, length = 1024)
@Column(name = TOPIC_DESCRIPTION, length = DESCRIPTION_ROW_LENGTH)
protected String description;
@Column(name = TOPIC_CREATED_USERNAME)
protected String createdUsername;
Expand Down
Expand Up @@ -57,6 +57,7 @@ public class AddSdkProfileViewImpl
implements AddSdkProfileView, ValueChangeHandler<VersionDto> {

private static final String REQUIRED = Utils.avroUiStyle.requiredField();
private static final int SDK_NAME_TEXT_SIZE_BOX = 255;

private SizedTextBox name;

Expand Down Expand Up @@ -88,7 +89,7 @@ protected void initDetailsTable() {

Widget label = new Label(Utils.constants.name());
label.addStyleName(REQUIRED);
name = new KaaAdminSizedTextBox(255);
name = new KaaAdminSizedTextBox(SDK_NAME_TEXT_SIZE_BOX);
name.addInputHandler(this);
detailsTable.setWidget(0, 0, label);
detailsTable.setWidget(0, 1, name);
Expand Down
Expand Up @@ -33,6 +33,7 @@
public class TenantViewImpl extends BaseDetailsViewImpl implements TenantView {

private static final String REQUIRED = Utils.avroUiStyle.requiredField();
private static final int TENANT_NAME_TEXT_SIZE_BOX = 100;

private SizedTextBox tenantName;

Expand Down Expand Up @@ -65,7 +66,7 @@ protected String getSubTitle() {
@Override
protected void initDetailsTable() {

tenantName = new KaaAdminSizedTextBox(100);
tenantName = new KaaAdminSizedTextBox(TENANT_NAME_TEXT_SIZE_BOX);
tenantName.setWidth("100%");
tenantName.addInputHandler(this);
lableUser = new Label("Users");
Expand Down

0 comments on commit 3e50053

Please sign in to comment.