This is a Hibernate bug IMHO.
Also, I see that the @Lob problem is nothing new to Broadleaf Commerce.
https://github.com/BroadleafCommerce/Br ... 0595eacc0f
MySQL server support for CLOB with 4 data types:
TINYTEXT - A CLOB column with a maximum length of 255 (2**8 - 1) characters.
TEXT - A CLOB column with a maximum length of 65,535 (2**16 - 1) characters.
MEDIUMTEXT - A CLOB column with a maximum length of 16,777,215 (2**24 - 1) characters.
LONGTEXT - A CLOB column with a maximum length of 4,294,967,295 or 4GB (2**32 - 1) characters.
Tables / Entities in question.
BLC_SC_FLD => StructuredContentFieldImpl
BLC_SKU => SkuImpl
BLC_SKU_FEE => SkuFeeImpl
BLC_PAGE_FLD => PageFieldImpl
BLC_TRANSLATION => TranslationImpl
BLC_SC_ITEM_CRITERIA => StructuredContentItemCriteriaImpl
BLC_CATEGORY => CategoryImpl
BLC_PAGE_ITEM_CRITERIA => PageItemCriteriaImpl
BLC_FULFILLMENT_OPTION => FulfillmentOptionImpl
BLC_OFFER => OfferImpl
BLC_OFFER_ITEM_CRITERIA => OfferItemCriteriaImpl
BLC_PAGE_RULE => PageRuleImpl
BLC_SC_RULE => StructuredContentRuleImpl
BLC_FULFILLMENT_OPTION => FulfillmentOptionImp
BLC_SC_FLD => StructuredContentFieldImpl
/*
* Hibernate bug ... MySQL dialect should create a TEXT datatype for @Lob String(s)
* MySQL Notes:
* StringClobType produces invalid SQL
* MaterializedClobType produces invalid SQL
* TextType produces VARCHAR with invalid length in SQL
* length property in @Column is ignored, total row max = 65535
*/
//@Column(name = "LOB_VALUE")
//@Column(name = "LOB_VALUE", length = Integer.MAX_VALUE-1)
@Column(name = "LOB_VALUE", length = 65535)
//@Column(name = "LOB_VALUE", columnDefinition = "TEXT")
@Lob
//@Type(type = "org.hibernate.type.StringClobType")
//@Type(type = "org.hibernate.type.MaterializedClobType")
@Type(type = "org.hibernate.type.TextType")
protected String lobValue;
CREATE TABLE BLC_SC_FLD (
SC_FLD_ID BIGINT NOT NULL,
CREATED_BY BIGINT,
DATE_CREATED TIMESTAMP,
DATE_UPDATED TIMESTAMP,
UPDATED_BY BIGINT,
FLD_KEY VARCHAR(255),
LOB_VALUE VARCHAR(16777216),
VALUE VARCHAR(255),
SC_ID BIGINT
);
The LOB_VALUE now has a datatype but the row size exceeds the maximum size of 65535.
So let's replace all VARCHAR(16777216) with TEXT and see if all tables get created. ....
Yes, all tables get created.
Will this work if we then populate the data and set "create-drop" to none?
Let's see.
data population ...
config/bc/sql/load_admin_permissions.sql ....... success.
config/bc/sql/load_admin_roles.sql .................. success.
config/bc/sql/load_admin_menu.sql.................. success.
sql/load_admin_users.sql................................ success.
sql/load_code_tables.sql................................. success.
sql/load_table_sequences.sql.......................... success.
sql/load_content_structure.sql......................... success.
sql/load_catalog_data.sql................................ failure. Syntax errors.
sql/load_catalog_pricesplit_data.sql
sql/load_content_data.sql
sql/load_content_structure_i18n.sql
sql/load_content_data_i18n.sql
sql/load_catalog_i18n_data_FR.sql
sql/load_catalog_i18n_data_ES.sql
There are syntactical errors in the load_catalog_data.sql file like missing semi-colon(s), embedded apostrophe(s) in text fields.
And the load_catalog_pricesplit_data.sql does not exist as previosly mentioned in a prior post.
-Richard
This forum is in readonly mode and serves as an archive of old information. All posting, registration and commenting abilities have been turned off. To get help, the Broadleaf team reguarly monitors the broadleaf-commerce tag on Stack Overflow so please ask your questions there.