Zpráva z pracovní cesty prodloužena na 8kB

closes #220
Verze_2.0
František Přibyl 10 years ago
parent e5a8e0f0d9
commit fbc7a02161

@ -34,7 +34,7 @@ import java.util.Map;
public class Constants { public class Constants {
public final static long DB_VERSION = 4; public final static long DB_VERSION = 5;
public final static String DEF_ADMIN = "admin"; public final static String DEF_ADMIN = "admin";
public final static String DEF_ADMIN_PASSWD = "admin"; public final static String DEF_ADMIN_PASSWD = "admin";
@ -163,4 +163,5 @@ public class Constants {
public final static int LEN_TEXT = 255; public final static int LEN_TEXT = 255;
public final static int LEN_DESCRIPTION = 8192; public final static int LEN_DESCRIPTION = 8192;
public final static int LEN_RESULT_MESSAGE = 8192;
} }

@ -1,13 +1,12 @@
package info.bukova.isspst.data; package info.bukova.isspst.data;
import info.bukova.isspst.Constants;
import info.bukova.isspst.storage.EntityWithAttachment; import info.bukova.isspst.storage.EntityWithAttachment;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import java.math.BigDecimal;
import org.hibernate.search.annotations.Analyze; import java.util.ArrayList;
import org.hibernate.search.annotations.Field; import java.util.Date;
import org.hibernate.search.annotations.Index; import java.util.List;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
@ -17,10 +16,14 @@ import javax.persistence.JoinColumn;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table; import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.ArrayList; import org.hibernate.annotations.LazyCollection;
import java.util.Date; import org.hibernate.annotations.LazyCollectionOption;
import java.util.List; import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
@Entity @Entity
@Table(name = "TRIP_BILL") @Table(name = "TRIP_BILL")
@ -35,7 +38,7 @@ public class TripBill extends BaseData implements EntityWithAttachment {
@Column(name = "SIGN_DATE") @Column(name = "SIGN_DATE")
private Date signDate; private Date signDate;
@Column(name = "RESULT_MESSAGE") @Column(name = "RESULT_MESSAGE", length = Constants.LEN_RESULT_MESSAGE)
@Field(index = Index.YES, analyze = Analyze.YES) @Field(index = Index.YES, analyze = Analyze.YES)
private String resultMessage; private String resultMessage;

@ -60,6 +60,9 @@ public class DbInfoServiceImpl extends AbstractService<DbInfo> implements DbInfo
} }
} }
// String source = UserCountUtils.encryptUserCount(1000);
// long users = UserCountUtils.decryptUserCount(source);
long dbVersion = this.getDbInfo().getVersion(); long dbVersion = this.getDbInfo().getVersion();
if (Constants.DB_VERSION > dbVersion) if (Constants.DB_VERSION > dbVersion)
@ -133,6 +136,12 @@ public class DbInfoServiceImpl extends AbstractService<DbInfo> implements DbInfo
sq.executeUpdate(); sq.executeUpdate();
} }
if (dbVersion < 5) {
sql = "ALTER TABLE TRIP_BILL MODIFY RESULT_MESSAGE VARCHAR(" + String.valueOf(Constants.LEN_RESULT_MESSAGE) + ")";
sq = this.dao.getSession().createSQLQuery(sql);
sq.executeUpdate();
}
this.updateDatabaseVersion(); this.updateDatabaseVersion();
} }
} }

Loading…
Cancel
Save