Skip to content

Commit

Permalink
Read the new @Length annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed May 19, 2017
1 parent 4064aaf commit c7cbe4e
Showing 1 changed file with 6 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
package io.ebeaninternal.server.deploy.parse;

import io.ebean.annotation.Aggregation;
import io.ebean.annotation.CreatedTimestamp;
import io.ebean.annotation.DbArray;
import io.ebean.annotation.DbComment;
import io.ebean.annotation.DbHstore;
import io.ebean.annotation.DbJson;
import io.ebean.annotation.DbJsonB;
import io.ebean.annotation.DocCode;
import io.ebean.annotation.DocEmbedded;
import io.ebean.annotation.DocProperty;
import io.ebean.annotation.DocSortable;
import io.ebean.annotation.Draft;
import io.ebean.annotation.DraftDirty;
import io.ebean.annotation.DraftOnly;
import io.ebean.annotation.DraftReset;
import io.ebean.annotation.Encrypted;
import io.ebean.annotation.Expose;
import io.ebean.annotation.Formula;
import io.ebean.annotation.HistoryExclude;
import io.ebean.annotation.Index;
import io.ebean.annotation.JsonIgnore;
import io.ebean.annotation.SoftDelete;
import io.ebean.annotation.TenantId;
import io.ebean.annotation.UnmappedJson;
import io.ebean.annotation.UpdatedTimestamp;
import io.ebean.annotation.WhenCreated;
import io.ebean.annotation.WhenModified;
import io.ebean.annotation.WhoCreated;
import io.ebean.annotation.WhoModified;
import io.ebean.annotation.*;
import io.ebean.config.EncryptDeploy;
import io.ebean.config.EncryptDeploy.Mode;
import io.ebean.config.dbplatform.DbEncrypt;
Expand Down Expand Up @@ -315,7 +287,10 @@ private void readField(DeployBeanProperty prop) {
if (get(prop, HistoryExclude.class) != null) {
prop.setExcludedFromHistory();
}

Length length = get(prop, Length.class);
if (length != null) {
prop.setDbLength(length.value());
}
io.ebean.annotation.NotNull nonNull = get(prop, io.ebean.annotation.NotNull.class);
if (nonNull != null) {
prop.setNullable(false);
Expand Down Expand Up @@ -373,7 +348,7 @@ private void readField(DeployBeanProperty prop) {

private void addIndex(DeployBeanProperty prop, Index index) {
String[] columnNames;
if (index.columnNames() == null || index.columnNames().length == 0) {
if (index.columnNames().length == 0) {
columnNames = new String[]{prop.getDbColumn()};
} else {
columnNames = new String[index.columnNames().length];
Expand Down

0 comments on commit c7cbe4e

Please sign in to comment.