More edits for refactoring embedded entities into JSON cols
Former-commit-id: a82f46c846
embedded-to-json
parent
a369979f79
commit
a50e1fb99b
|
|
@ -11,6 +11,7 @@ import com.arsdigita.cms.contenttypes.ui.ProfileSiteItemMiscStep;
|
||||||
import com.arsdigita.cms.contenttypes.ui.ProfileSiteItemPositionStep;
|
import com.arsdigita.cms.contenttypes.ui.ProfileSiteItemPositionStep;
|
||||||
import com.arsdigita.cms.contenttypes.ui.ProfileSiteItemPropertiesStep;
|
import com.arsdigita.cms.contenttypes.ui.ProfileSiteItemPropertiesStep;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
import org.libreccm.l10n.LocalizedString;
|
import org.libreccm.l10n.LocalizedString;
|
||||||
import org.librecms.assets.Person;
|
import org.librecms.assets.Person;
|
||||||
import org.librecms.contentsection.ContentItem;
|
import org.librecms.contentsection.ContentItem;
|
||||||
|
|
@ -21,6 +22,7 @@ import org.librecms.contenttypes.ContentTypeDescription;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.persistence.AssociationOverride;
|
import javax.persistence.AssociationOverride;
|
||||||
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Embedded;
|
import javax.persistence.Embedded;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
|
|
@ -85,43 +87,49 @@ public class ProfileSiteItem extends ContentItem {
|
||||||
@JoinColumn(name = "OWNER_ID")
|
@JoinColumn(name = "OWNER_ID")
|
||||||
private Person owner;
|
private Person owner;
|
||||||
|
|
||||||
@Embedded
|
// @Embedded
|
||||||
@AssociationOverride(
|
// @AssociationOverride(
|
||||||
name = "values",
|
// name = "values",
|
||||||
joinTable = @JoinTable(
|
// joinTable = @JoinTable(
|
||||||
name = "PROFILE_SITE_ITEMS_POSITION",
|
// name = "PROFILE_SITE_ITEMS_POSITION",
|
||||||
schema = DB_SCHEMA,
|
// schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
// joinColumns = {
|
||||||
@JoinColumn(name = "PROFILE_SITE_ITEM_ID")
|
// @JoinColumn(name = "PROFILE_SITE_ITEM_ID")
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
)
|
// )
|
||||||
|
@Column(name = "POSITION")
|
||||||
|
@Type(type = "org.libreccm.l10n.LocalizedStringType")
|
||||||
private LocalizedString position;
|
private LocalizedString position;
|
||||||
|
|
||||||
@Embedded
|
// @Embedded
|
||||||
@AssociationOverride(
|
// @AssociationOverride(
|
||||||
name = "values",
|
// name = "values",
|
||||||
joinTable = @JoinTable(
|
// joinTable = @JoinTable(
|
||||||
name = "PROFILE_SITE_ITEMS_INTERESTS",
|
// name = "PROFILE_SITE_ITEMS_INTERESTS",
|
||||||
schema = DB_SCHEMA,
|
// schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
// joinColumns = {
|
||||||
@JoinColumn(name = "PROFILE_SITE_ITEM_ID")
|
// @JoinColumn(name = "PROFILE_SITE_ITEM_ID")
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
)
|
// )
|
||||||
|
@Column(name = "INTERESTS")
|
||||||
|
@Type(type = "org.libreccm.l10n.LocalizedStringType")
|
||||||
private LocalizedString interests;
|
private LocalizedString interests;
|
||||||
|
|
||||||
@Embedded
|
// @Embedded
|
||||||
@AssociationOverride(
|
// @AssociationOverride(
|
||||||
name = "values",
|
// name = "values",
|
||||||
joinTable = @JoinTable(
|
// joinTable = @JoinTable(
|
||||||
name = "PROFILE_SITE_ITEMS_MISC",
|
// name = "PROFILE_SITE_ITEMS_MISC",
|
||||||
schema = DB_SCHEMA,
|
// schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
// joinColumns = {
|
||||||
@JoinColumn(name = "PROFILE_SITE_ITEM_ID")
|
// @JoinColumn(name = "PROFILE_SITE_ITEM_ID")
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
)
|
// )
|
||||||
|
@Column(name = "MISC")
|
||||||
|
@Type(type = "org.libreccm.l10n.LocalizedStringType")
|
||||||
private LocalizedString misc;
|
private LocalizedString misc;
|
||||||
|
|
||||||
public ProfileSiteItem() {
|
public ProfileSiteItem() {
|
||||||
|
|
|
||||||
|
|
@ -333,11 +333,15 @@
|
||||||
<groupId>de.jpdigital</groupId>
|
<groupId>de.jpdigital</groupId>
|
||||||
<artifactId>hibernate53-ddl-maven-plugin</artifactId>
|
<artifactId>hibernate53-ddl-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<dialects>
|
<!-- <dialects>
|
||||||
<param>h2</param>
|
<param>h2</param>
|
||||||
<param>oracle12c</param>
|
<param>oracle12c</param>
|
||||||
<param>postgresql9</param>
|
<param>postgresql9</param>
|
||||||
</dialects>
|
</dialects>-->
|
||||||
|
<customDialects>
|
||||||
|
<param>org.libreccm.hibernate.dialects.LibreCcmH2Dialect</param>
|
||||||
|
<param>org.libreccm.hibernate.dialects.LibreCcmPgSql9Dialect</param>
|
||||||
|
</customDialects>
|
||||||
<packages>
|
<packages>
|
||||||
<param>org.libreccm.categorization</param>
|
<param>org.libreccm.categorization</param>
|
||||||
<param>org.libreccm.core</param>
|
<param>org.libreccm.core</param>
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ public class DatasetsVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String[] getDdlFiles() {
|
protected String[] getDdlFiles() {
|
||||||
return new String[]{"/sql/ddl/auto/h2.sql"};
|
return new String[]{"/sql/ddl/auto/libreccmh2.sql"};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processDdlFile(final Connection connection,
|
private void processDdlFile(final Connection connection,
|
||||||
|
|
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -814,7 +814,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>1.4.199</version>
|
<version>1.4.200</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- WebJars -->
|
<!-- WebJars -->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue