latest code

This commit is contained in:
aranganath 2005-03-14 15:44:54 +00:00
parent 018680a70e
commit 60b736246b
15 changed files with 122 additions and 193 deletions

View File

@ -13,7 +13,7 @@
<property name="connection.username">javauser</property>
<property name="connection.password">javadude</property> -->
<property name="show_sql">false</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<!-- <property name="max_fetch_depth">15</property>

View File

@ -1,17 +1,17 @@
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file hibernate.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/dictionary-hibernate.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file lex.log ###
log4j.appender.lex-out=org.apache.log4j.FileAppender
log4j.appender.lex-out.File=/dictionary.log
log4j.appender.lex-out.layout=org.apache.log4j.PatternLayout
log4j.appender.lex-out.layout.ConversionPattern=%d{ABattribute>
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file hibernate.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/dictionary-hibernate.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file lex.log ###
log4j.appender.lex-out=org.apache.log4j.FileAppender
log4j.appender.lex-out.File=/dictionary.log
log4j.appender.lex-out.layout=org.apache.log4j.PatternLayout
log4j.appender.lex-out.layout.ConversionPattern=%d{ABattribute>

View File

@ -1,11 +1,13 @@
package org.thdl.lex;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
import org.thdl.lex.component.ILexComponent;
import org.thdl.lex.component.ITerm;
import org.thdl.lex.component.TransitionalDataComparator;
/**
* Description of the Class

View File

@ -2,6 +2,7 @@ package org.thdl.lex.component;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang.builder.ToStringBuilder;
@ -29,7 +30,7 @@ abstract public class BaseTerm extends LexComponent implements
private List encyclopediaArticles;
/** persistent field */
private List transitionalData;
private Set transitionalData;
/** persistent field */
private List definitions;
@ -59,7 +60,7 @@ abstract public class BaseTerm extends LexComponent implements
public BaseTerm(Boolean deleted, List analyticalNotes,
org.thdl.lex.component.Meta meta, String term, List pronunciations,
List etymologies, List spellings, List functions,
List encyclopediaArticles, List transitionalData, List definitions,
List encyclopediaArticles, Set transitionalData, List definitions,
List glosses, List keywords, List modelSentences,
List translationEquivalents, List relatedTerms, List passages,
List registers) {
@ -133,11 +134,11 @@ abstract public class BaseTerm extends LexComponent implements
this.encyclopediaArticles = encyclopediaArticles;
}
public List getTransitionalData() {
public Set getTransitionalData() {
return this.transitionalData;
}
public void setTransitionalData(List transitionalData) {
public void setTransitionalData(Set transitionalData) {
this.transitionalData = transitionalData;
}

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.List;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.thdl.lex.component.child.TransitionalDataLabel;
/** @author Hibernate CodeGenerator */
abstract public class BaseTransitionalData extends LexComponent implements
@ -13,7 +14,7 @@ abstract public class BaseTransitionalData extends LexComponent implements
private Integer parentId;
/** nullable persistent field */
private Integer transitionalDataLabel;
private TransitionalDataLabel transitionalDataLabel;
/** persistent field */
private String forPublicConsumption;
@ -27,7 +28,7 @@ abstract public class BaseTransitionalData extends LexComponent implements
/** full constructor */
public BaseTransitionalData(Boolean deleted, List analyticalNotes,
org.thdl.lex.component.Meta meta, Integer parentId,
Integer transitionalDataLabel, String forPublicConsumption,
TransitionalDataLabel transitionalDataLabel, String forPublicConsumption,
String transitionalDataText,
org.thdl.lex.component.ILexComponent parent) {
super(deleted, analyticalNotes, meta);
@ -57,11 +58,11 @@ abstract public class BaseTransitionalData extends LexComponent implements
this.parentId = parentId;
}
public Integer getTransitionalDataLabel() {
public TransitionalDataLabel getTransitionalDataLabel() {
return this.transitionalDataLabel;
}
public void setTransitionalDataLabel(Integer transitionalDataLabel) {
public void setTransitionalDataLabel(TransitionalDataLabel transitionalDataLabel) {
this.transitionalDataLabel = transitionalDataLabel;
}

View File

@ -115,7 +115,7 @@ public interface ITerm extends LexComponentNode {
* @return The transitionalData value
* @since
*/
public java.util.List getTransitionalData();
public java.util.Set getTransitionalData();
/**
* Sets the transitionalData attribute of the ITerm object
@ -124,7 +124,7 @@ public interface ITerm extends LexComponentNode {
* The new transitionalData value
* @since
*/
public void setTransitionalData(java.util.List transitionalData);
public void setTransitionalData(java.util.Set transitionalData);
/**
* Gets the definitions attribute of the ITerm object

View File

@ -1,5 +1,7 @@
package org.thdl.lex.component;
import org.thdl.lex.component.child.TransitionalDataLabel;
/**
* Description of the Interface
*
@ -28,7 +30,7 @@ public interface ITransitionalData extends ILexComponent {
*
* @return The transitionalDataLabel value
*/
public java.lang.Integer getTransitionalDataLabel();
public TransitionalDataLabel getTransitionalDataLabel();
/**
* Sets the transitionalDataLabel attribute of the ITransitionalData object
@ -36,7 +38,7 @@ public interface ITransitionalData extends ILexComponent {
* @param transitionalDataLabel
* The new transitionalDataLabel value
*/
public void setTransitionalDataLabel(java.lang.Integer transitionalDataLabel);
public void setTransitionalDataLabel(TransitionalDataLabel transitionalDataLabel);
/**
* Gets the forPublicConsumption attribute of the ITransitionalData object

View File

@ -1,26 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping default-cascade="all">
<!-- <class name="org.thdl.lex.component.LexComponent" proxy="org.thdl.lex.component.ILexComponent" table="Meta" where="deleted=0" unsaved-value="0"> -->
<class name="org.thdl.lex.component.LexComponent" proxy="org.thdl.lex.component.ILexComponent" table="Meta" where="deleted=0">
<meta attribute="generated-class" inherit="false">org.thdl.lex.component.BaseLexComponent</meta>
<id name="metaId" type="java.lang.Integer" column="metaId">
<!-- <meta attribute="finder-method">findById</meta> -->
<!-- <meta attribute="finder-method">findById</meta> -->
<generator class="native"/>
</id>
<!--<property name="translationOf" type="java.lang.Integer" column="translationOf" length="11"/> -->
<property name="deleted" type="java.lang.Boolean" column="deleted" not-null="true" length="5"/>
<list name="analyticalNotes" table="AnalyticalNotes" lazy="true">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.AnalyticalNote"/>
</list>
<component name="meta" class="org.thdl.lex.component.Meta">
<meta attribute="generated-class">org.thdl.lex.component.BaseMeta</meta>
<property name="createdBy" type="java.lang.Integer" column="createdBy" not-null="true" length="11"/>
@ -35,20 +29,18 @@
<property name="dialect" type="java.lang.Integer" column="dialect" not-null="true" length="6"/>
<property name="note" type="java.lang.String" column="note" length="65535"/>
</component>
<joined-subclass name="org.thdl.lex.component.AnalyticalNote" proxy="org.thdl.lex.component.IAnalyticalNote" table="AnalyticalNotes">
<meta attribute="generated-class">org.thdl.lex.component.BaseAnalyticalNote</meta>
<key column="metaId">
<!--<meta attribute="gen-property">false</meta>-->
</key>
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="analyticalNote" type="java.lang.String" column="analyticalNote" length="65535"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Term" proxy="org.thdl.lex.component.ITerm" table="Terms">
<meta attribute="generated-class">org.thdl.lex.component.BaseTerm</meta>
<meta attribute="implements">org.thdl.lex.component.LexComponentNode</meta>
@ -64,7 +56,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Pronunciation"/>
</list>
<list name="etymologies" table="Etymologies" lazy="true" where="translationOf IS NULL">
<list name="etymologies" table="Etymologies" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Etymology"/>
@ -84,12 +76,11 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.EncyclopediaArticle"/>
</list>
<list name="transitionalData" table="TransitionalData" lazy="true">
<set name="transitionalData" table="TransitionalData" sort="org.thdl.lex.component.TransitionalDataComparator">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.TransitionalData"/>
</list>
<list name="definitions" table="Definitions" lazy="true" where="translationOf IS NULL">
</set>
<list name="definitions" table="Definitions" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Definition"/>
@ -104,7 +95,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Keyword"/>
</list>
<list name="modelSentences" table="ModelSentences" lazy="true" where="translationOf IS NULL">
<list name="modelSentences" table="ModelSentences" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.ModelSentence"/>
@ -119,7 +110,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.RelatedTerm"/>
</list>
<list name="passages" table="Passages" lazy="true" where="translationOf IS NULL">
<list name="passages" table="Passages" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Passage"/>
@ -130,7 +121,6 @@
<one-to-many class="org.thdl.lex.component.SpeechRegister"/>
</list>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Definition" proxy="org.thdl.lex.component.IDefinition" table="Definitions">
<meta attribute="generated-class">org.thdl.lex.component.BaseDefinition</meta>
<meta attribute="implements">org.thdl.lex.component.Translatable, org.thdl.lex.component.LexComponentNode</meta>
@ -139,7 +129,7 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="definition" type="java.lang.String" column="definition" length="65535"/>
@ -149,7 +139,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Definition"/>
</list>
<list name="subdefinitions" table="Subdefinitions" lazy="true" where="translationOf IS NULL">
<list name="subdefinitions" table="Subdefinitions" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Subdefinition"/>
@ -164,7 +154,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Keyword"/>
</list>
<list name="modelSentences" table="ModelSentences" lazy="true" where="translationOf IS NULL">
<list name="modelSentences" table="ModelSentences" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.ModelSentence"/>
@ -179,7 +169,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.RelatedTerm"/>
</list>
<list name="passages" table="Passages" lazy="true" where="translationOf IS NULL">
<list name="passages" table="Passages" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Passage"/>
@ -190,7 +180,6 @@
<one-to-many class="org.thdl.lex.component.SpeechRegister"/>
</list>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Subdefinition" proxy="org.thdl.lex.component.ISubdefinition" table="Subdefinitions">
<meta attribute="generated-class">org.thdl.lex.component.BaseSubdefinition</meta>
<meta attribute="implements">org.thdl.lex.component.Translatable, org.thdl.lex.component.LexComponentNode</meta>
@ -199,7 +188,7 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="subdefinition" type="java.lang.String" column="subdefinition" length="65535"/>
@ -219,7 +208,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Keyword"/>
</list>
<list name="modelSentences" table="ModelSentences" lazy="true" where="translationOf IS NULL">
<list name="modelSentences" table="ModelSentences" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.ModelSentence"/>
@ -234,7 +223,7 @@
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.RelatedTerm"/>
</list>
<list name="passages" table="Passages" lazy="true" where="translationOf IS NULL">
<list name="passages" table="Passages" lazy="true" where="translationOf IS NULL">
<key column="parentId"/>
<index column="precedence"/>
<one-to-many class="org.thdl.lex.component.Passage"/>
@ -245,7 +234,6 @@
<one-to-many class="org.thdl.lex.component.SpeechRegister"/>
</list>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Pronunciation" proxy="org.thdl.lex.component.IPronunciation" table="Pronunciations">
<meta attribute="generated-class">org.thdl.lex.component.BasePronunciation</meta>
<key column="metaId">
@ -253,13 +241,12 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="phonetics" type="java.lang.String" column="phonetics" not-null="true" length="65535"/>
<property name="phoneticsType" type="java.lang.Integer" column="phoneticsType" not-null="true" length="6"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Etymology" proxy="org.thdl.lex.component.IEtymology" table="Etymologies">
<meta attribute="generated-class">org.thdl.lex.component.BaseEtymology</meta>
<meta attribute="implements">org.thdl.lex.component.Translatable</meta>
@ -268,7 +255,7 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="loanLanguage" type="java.lang.Integer" column="loanLanguage" length="6"/>
@ -282,7 +269,6 @@
<one-to-many class="org.thdl.lex.component.Etymology"/>
</list>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Spelling" proxy="org.thdl.lex.component.ISpelling" table="Spellings">
<meta attribute="generated-class">org.thdl.lex.component.BaseSpelling</meta>
<key column="metaId">
@ -290,13 +276,12 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="spelling" type="java.lang.String" column="spelling" not-null="true" length="255"/>
<property name="spellingType" type="java.lang.Integer" column="spellingType" not-null="true" length="6"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.GrammaticalFunction" proxy="org.thdl.lex.component.IFunction" table="GrammaticalFunctions">
<meta attribute="generated-class">org.thdl.lex.component.BaseGrammaticalFunction</meta>
<key column="metaId">
@ -304,12 +289,11 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="function" type="java.lang.Integer" column="function" not-null="true" length="6"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.EncyclopediaArticle" proxy="org.thdl.lex.component.IEncyclopediaArticle" table="EncyclopediaArticles">
<meta attribute="generated-class">org.thdl.lex.component.BaseEncyclopediaArticle</meta>
<key column="metaId">
@ -317,13 +301,12 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="article" type="java.lang.String" column="article" not-null="true" length="65535"/>
<property name="articleTitle" type="java.lang.String" column="articleTitle" not-null="true" length="65535"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Gloss" proxy="org.thdl.lex.component.IGloss" table="Glosses">
<meta attribute="generated-class">org.thdl.lex.component.BaseGloss</meta>
<key column="metaId">
@ -331,13 +314,12 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="gloss" type="java.lang.String" column="gloss" length="65535"/>
<property name="translation" type="java.lang.String" column="translation" length="65535"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Keyword" proxy="org.thdl.lex.component.IKeyword" table="Keywords">
<meta attribute="generated-class">org.thdl.lex.component.BaseKeyword</meta>
<key column="metaId">
@ -345,12 +327,11 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="keyword" type="java.lang.String" column="keyword" length="65535"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.ModelSentence" proxy="org.thdl.lex.component.IModelSentence" table="ModelSentences">
<meta attribute="generated-class">org.thdl.lex.component.BaseModelSentence</meta>
<meta attribute="implements">org.thdl.lex.component.Translatable</meta>
@ -359,7 +340,7 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="modelSentence" type="java.lang.String" column="modelSentence" length="65535"/>
@ -370,7 +351,6 @@
<one-to-many class="org.thdl.lex.component.ModelSentence"/>
</list>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.TranslationEquivalent" proxy="org.thdl.lex.component.ITranslationEquivalent" table="TranslationEquivalents">
<meta attribute="generated-class">org.thdl.lex.component.BaseTranslationEquivalent</meta>
<key column="metaId">
@ -378,12 +358,11 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="translationEquivalent" type="java.lang.String" column="translationEquivalent" length="65535"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.RelatedTerm" proxy="org.thdl.lex.component.IRelatedTerm" table="RelatedTerms">
<meta attribute="generated-class">org.thdl.lex.component.BaseRelatedTerm</meta>
<key column="metaId">
@ -391,13 +370,12 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="relatedTerm" type="java.lang.String" column="relatedTerm" length="65535"/>
<property name="relatedTermType" type="java.lang.Integer" column="relatedTermType" not-null="true" length="6"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.Passage" proxy="org.thdl.lex.component.IPassage" table="LiteraryQuotations">
<meta attribute="generated-class">org.thdl.lex.component.BasePassage</meta>
<meta attribute="implements">org.thdl.lex.component.Translatable</meta>
@ -406,7 +384,7 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="literarySource" type="java.lang.String" column="literarySource" length="65535"/>
@ -420,7 +398,6 @@
<one-to-many class="org.thdl.lex.component.Passage"/>
</list>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.SpeechRegister" proxy="org.thdl.lex.component.IRegister" table="SpeechRegisters">
<meta attribute="generated-class">org.thdl.lex.component.BaseSpeechRegister</meta>
<key column="metaId">
@ -428,12 +405,11 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="register" type="java.lang.Integer" column="register" not-null="true" length="6"/>
</joined-subclass>
<joined-subclass name="org.thdl.lex.component.TransitionalData" proxy="org.thdl.lex.component.ITransitionalData" table="TransitionalData">
<meta attribute="generated-class">org.thdl.lex.component.BaseTransitionalData</meta>
<key column="metaId">
@ -441,15 +417,19 @@
</key>
<property name="parentId" type="java.lang.Integer" column="parentId" length="11">
<!--<meta attribute="gen-property">false</meta>-->
</property>
</property>
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
<!--<property name="precedence" type="java.lang.Integer" column="precedence" length="6"/>-->
<property name="transitionalDataLabel" type="java.lang.Integer" column="transitionalDataLabel" length="6"/>
<many-to-one name="transitionalDataLabel" class="org.thdl.lex.component.child.TransitionalDataLabel" column="transitionalDataLabel" />
<property name="forPublicConsumption" type="java.lang.String" column="forPublicConsumption" not-null="true" length="5"/>
<property name="transitionalDataText" type="java.lang.String" column="transitionalDataText" length="65535"/>
</joined-subclass>
</class>
</hibernate-mapping>
<class name="org.thdl.lex.component.child.TransitionalDataLabel" table="TransitionalDataLabels">
<id name="id" type="short" column="id">
<generator class="native" />
</id>
<property name="transitionalDataLabel" type="java.lang.String" column="transitionalDataLabel" length="65535"/>
<property name="priority" type="java.lang.Integer" column="priority"/>
</class>
</hibernate-mapping>

View File

@ -0,0 +1,29 @@
/*
* Created on Feb 22, 2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.thdl.lex.component;
import java.util.Comparator;
/**
* @author Anoop
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class TransitionalDataComparator implements Comparator {
/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
public int compare(Object o1, Object o2) {
TransitionalData td1 = (TransitionalData) o1;
TransitionalData td2 = (TransitionalData) o2;
return td1.getTransitionalDataLabel().getPriority().compareTo(td2.getTransitionalDataLabel().getPriority());
}
}

View File

@ -14,6 +14,8 @@ public class TransitionalDataLabel implements Serializable {
/** nullable persistent field */
private String transitionalDataLabel;
private Integer priority;
/** full constructor */
public TransitionalDataLabel(String transitionalDataLabel) {
@ -56,4 +58,11 @@ public class TransitionalDataLabel implements Serializable {
return new HashCodeBuilder().append(getId()).toHashCode();
}
public Integer getPriority() {
return priority;
}
public void setPriority(Integer priority) {
this.priority = priority;
}
}

View File

@ -245,111 +245,11 @@ public class DictionaryImporter {
term = Manipulate.replace(term, " ", " ");
if (out != null)
out.println(term + " - " + definition);
else if (sqlStatement != null)
addRecordManually(term, definition);
else
addRecordViaHibernate(term, definition);
addRecordManually(term, definition);
}
/**
* Main class to map the term and its definition to the Lex Component object
* model. Works but painfully slow!
*/
public void addRecordViaHibernate(String term, String definition)
throws Exception {
LinkedList ll;
ListIterator li;
ITerm lexTerm;
TransitionalData trans = null;
boolean found, newTerm = false;
String existingDef;
// displaying for debugging purposes only
// System.out.println(term);
//check to see if the term already exists
lexTerm = LexComponentRepository.loadTermByTerm(term);
found = false;
//if it doesn't create a new term.
if (null == lexTerm) {
// System.out.println("New term");
lexTerm = new Term();
lexTerm.setTerm(term);
lexTerm.setMeta(defaultMeta());
//save the Term to the database. This step is necessary here to
// generate a unique id
LexComponentRepository.save(lexTerm);
newTerm = true;
} else {
// System.out.println("Old term");
li = lexTerm.getTransitionalData().listIterator();
while (li.hasNext()) {
trans = (TransitionalData) li.next();
if (trans.getMeta().getCreatedByProjSub().equals(proj)) {
found = true;
break;
}
}
newTerm = false;
}
//OLD CODE
/*
* TransitionalData trans = getTransData( lexTerm.getId() );
*
* trans.setTransitionalDataLabel( new Short( "1" ) );
* trans.setForPublicConsumption( "true" ); trans.setTermId(
* termParent.getId() );
*
* String newText = null; if (null != trans.getTransitionalDataText() )
* newText = trans.getTransitionalDataText() + ". " +
* def.toString().trim(); else newText = def.toString().trim();
* trans.setTransitionalDataText( newText ); trans.save();
*
* out.print( termParent.getTerm() + " ");
*
* int subTarget = 30; if ( trans.getTransitionalDataText().length() <
* 40 ) subTarget = trans.getTransitionalDataText().length(); out.print(
* trans.getTransitionalDataText().substring( 0, subTarget ) );
*/
//NEW CODE
// check if there is already a defition for this project
if (found) {
existingDef = trans.getTransitionalDataText().trim();
if (existingDef.equals(""))
found = false;
else if (existingDef.indexOf(definition) < 0) {
definition = existingDef + ". " + definition;
found = false;
}
} else {
// System.out.println("New definition");
trans = new TransitionalData();
trans.setMeta(defaultMeta());
trans.setTransitionalDataLabel(label);
trans.setParentId(lexTerm.getMetaId());
trans.setForPublicConsumption(publicCons);
if (newTerm) {
ll = new LinkedList();
ll.add(trans);
lexTerm.setTransitionalData(ll);
} else
lexTerm.getTransitionalData().add(trans);
}
if (!found) {
trans.setTransitionalDataText(definition);
//save the Term to the database.
LexComponentRepository.save(lexTerm);
}
}
public Meta defaultMeta() {
//use the file src/sql/import-updates.sql to add new metadata for use
// in this method.

View File

@ -18,7 +18,7 @@
</span>
</c:if>
<span><c:out value="${ applicationScope.flatData.transitionalDataLabels[ transitionalData.transitionalDataLabel ] }" /></span> <c:out value="${ pronunciation.phonetics }" escapeXml="false"/> <br />
<span><c:out value="${ transitionalData.transitionalDataLabel.transitionalDataLabel }" /></span> <c:out value="${ pronunciation.phonetics }" escapeXml="false"/> <br />
<c:out value="${ transitionalData.transitionalDataText }" escapeXml="false"/>
<jsp:include page="displayMeta.jsf" />

View File

@ -130,7 +130,12 @@
<c:set value="${sessionScope.visit.query.entry.transitionalData}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${sessionScope.visit.helper.hashCodeForCollection}">Other Dictionaries</a></li>' escapeXml='false' />
<c:forEach var="transitionalData" items="${ sessionScope.visit.query.entry.transitionalData }"></c:forEach>
<c:forEach var="transitionalData" items="${ sessionScope.visit.query.entry.transitionalData }">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${transitionalData}"/>
<c:if test="${ transitionalData.forPublicConsumption == 'true' || ! sessionScope.visit.user.guest }">
<a href="#<c:out value="${ sessionScope.visit.helper.hashCodeForComponent }" />"><li>-- <c:out value="${ transitionalData.transitionalDataLabel.transitionalDataLabel }" /></li></a>
</c:if>
</c:forEach>
</c:if>

View File

@ -2,7 +2,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<ul class="navLinks">
<li>
<a href="http://iris.lib.virginia.edu/tibet/reference/dictionary.html">Dictionary Home</a> |
<a href="/lex/">Dictionary Home</a> |
</li>
<li>
<a href="/lex/action?cmd=menu" title="Main Menu">Main Menu</a> |

View File

@ -42,7 +42,7 @@
<c:out value="${ originalEtymologyDescription } " escapeXml='false' />
<c:out value="${ applicationScope.flatData.transitionalDataLabels[ component.transitionalDataLabel ] }" /> Text: <br />
<c:out value="${ component.transitionalDataLabel.transitionalDataLabel }" /> Text: <br />
<textarea name="transitionalDataText" rows="8" cols="90"><c:if test="${ param.cmd != 'getTranslationForm'}"><c:out value='${ transitionalDataText }' escapeXml='false' /></c:if></textarea>
<br />