Furthor work against the model definition.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@520584 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-03-20 21:00:33 +00:00
parent 3331e0fd83
commit 3bdf3b8e70
3 changed files with 1277 additions and 483 deletions

View File

@ -65,30 +65,21 @@
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<version>1.0-alpha-15-SNAPSHOT</version>
<executions>
<execution>
<id>archiva-base</id>
<goals>
<goal>java</goal>
<goal>xsd</goal>
<goal>jpox-jdo-mapping</goal>
<goal>jpox-metadata-class</goal>
<goal>xpp3-writer</goal>
<goal>xpp3-reader</goal>
</goals>
<configuration>
<version>1.0.0</version>
<packageWithVersion>false</packageWithVersion>
<model>src/main/mdo/archiva.xml</model>
</configuration>
<executions>
<execution>
<id>modello-java</id>
<goals>
<goal>java</goal>
<goal>jpox-metadata-class</goal>
<!--
<goal>xpp3-writer</goal>
<goal>xpp3-reader</goal>
-->
</goals>
</execution>
<execution>
<id>jpox-jdo-mapping</id>
<goals>
<goal>jpox-jdo-mapping</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/org/apache/maven/archiva/model/</outputDirectory>
<model>src/main/mdo/archiva-base.xml</model>
</configuration>
</execution>
</executions>

File diff suppressed because it is too large Load Diff

View File

@ -1,468 +0,0 @@
<?xml version="1.0" ?>
<model jpox.table-prefix="ARCHIVA_">
<id>archiva-model</id>
<name>ArchivaModel</name>
<version>1.0.0</version>
<description>Archiva Model</description>
<defaults>
<default>
<key>package</key>
<value>org.apache.maven.archiva.model</value>
</default>
</defaults>
<classes>
<class stash.storable="false" rootElement="true">
<name>ArchivaDatabase</name>
<version>1.0.0+</version>
<fields>
<field>
<name>Repositories</name>
<version>1.0.0+</version>
<association>
<type>ArchivaRepositoryModel</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
<class stash.storable="true"
jpox.table="REPOSITORIES">
<name>ArchivaRepositoryModel</name>
<version>1.0.0+</version>
<fields>
<field>
<name>id</name>
<identity>true</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The unique ID for the repository.
</description>
</field>
<field>
<name>name</name>
<identity>false</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The Name of the repository.
</description>
</field>
<field>
<name>url</name>
<identity>false</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The URL of the repository.
</description>
</field>
<field>
<name>creationSource</name>
<identity>false</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The Source of this repository.
(Example: Configuration, POM)
</description>
</field>
<field>
<name>layoutName</name>
<identity>false</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The layout of the repository.
(Either 'default', or 'legacy')
</description>
</field>
<field>
<name>releasePolicy</name>
<identity>false</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The releases policy of the repository.
</description>
</field>
<field>
<name>snapshotPolicy</name>
<identity>false</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The snapshot policy of the repository.
</description>
</field>
</fields>
</class>
<class stash.storable="true"
jpox.table="REPOSITORY_CONTENT_KEYS"
jpox.use-identifiers-as-primary-key="true"
jpox.identity-type="application"
jpox.identity-class="RepositoryContentKey">
<name>RepositoryContent</name>
<version>1.0.0+</version>
<description>
Repository Content Identifier.
</description>
<fields>
<field jpox.primary-key="true"
jpox.value-strategy="off"
jpox.persistence-modifier="persistent">
<name>groupId</name>
<identity>true</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The Group ID of the repository content.
</description>
</field>
<field jpox.primary-key="true"
jpox.value-strategy="off"
jpox.persistence-modifier="persistent">
<name>artifactId</name>
<identity>true</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The Artifact ID of the repository content.
</description>
</field>
<field jpox.primary-key="true"
jpox.value-strategy="off"
jpox.persistence-modifier="persistent">
<name>version</name>
<identity>true</identity>
<version>1.0.0+</version>
<type>String</type>
<required>false</required>
<description>
The version of the repository content.
</description>
</field>
<field jpox.primary-key="true"
jpox.value-strategy="off"
jpox.persistence-modifier="persistent">
<name>repositoryId</name>
<identity>true</identity>
<version>1.0.0+</version>
<required>true</required>
<type>String</type>
<description>
The repository associated with this content.
</description>
</field>
</fields>
<codeSegments>
<codeSegment>
<version>1.0.0+</version>
<code>
public RepositoryContent( String groupId, String artifactId, String version )
{
this.setGroupId( groupId );
this.setArtifactId( artifactId );
this.setVersion( version );
}
public RepositoryContent( String repositoryId, String groupId, String artifactId, String version )
{
this.setRepositoryId( repositoryId );
this.setGroupId( groupId );
this.setArtifactId( artifactId );
this.setVersion( version );
}
public RepositoryContent( ArchivaRepositoryModel repository, String groupId, String artifactId, String version )
{
this.setRepositoryId( repository.getId() );
this.setGroupId( groupId );
this.setArtifactId( artifactId );
this.setVersion( version );
}
</code>
</codeSegment>
</codeSegments>
</class>
<class stash.storable="true"
jpox.table="ARTIFACTS">
<name>ArchivaArtifactModel</name>
<version>1.0.0+</version>
<fields>
<field>
<name>contentKey</name>
<identity>true</identity>
<version>1.0.0+</version>
<required>true</required>
<association>
<type>RepositoryContent</type>
<multiplicity>1</multiplicity>
</association>
<description>
The content key for this artifact.
</description>
</field>
<field>
<name>classifier</name>
<identity>false</identity>
<version>1.0.0+</version>
<type>String</type>
<required>false</required>
<description>
The classifier for this artifact.
</description>
</field>
<field jpox.column="FILE_TYPE">
<name>type</name>
<identity>true</identity>
<version>1.0.0+</version>
<type>String</type>
<required>true</required>
<description>
The type of artifact.
</description>
</field>
</fields>
</class>
<class stash.storable="true"
jpox.table="REPOSITORY_METADATAS">
<name>ArchivaRepositoryMetadata</name>
<version>1.0.0+</version>
<fields>
<field>
<name>contentKey</name>
<identity>true</identity>
<version>1.0.0+</version>
<required>true</required>
<association>
<type>RepositoryContent</type>
<multiplicity>1</multiplicity>
</association>
<description>
The content key for this repository metadata.
</description>
</field>
<field>
<name>releasedVersion</name>
<identity>false</identity>
<version>1.0.0+</version>
<required>false</required>
<type>String</type>
<description>
The released version id.
</description>
</field>
<field>
<name>availableVersions</name>
<identity>false</identity>
<version>1.0.0+</version>
<required>false</required>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
</association>
<description>
The list of available version ids.
</description>
</field>
</fields>
</class>
<class stash.storable="true"
jpox.table="HEALTH_PROBLEMS">
<name>HealthProblem</name>
<version>1.0.0+</version>
<fields>
<field jpox.column="PROBLEM_TYPE">
<name>type</name>
<identity>false</identity>
<version>1.0.0+</version>
<required>true</required>
<type>String</type>
<description>
The type of health problem.
</description>
</field>
<field jpox.column="PROBLEM_ORIGIN">
<name>origin</name>
<identity>false</identity>
<version>1.0.0+</version>
<required>true</required>
<type>String</type>
<description>
The origin of the health problem.
</description>
</field>
<field>
<name>message</name>
<identity>false</identity>
<version>1.0.0+</version>
<required>true</required>
<type>String</type>
<description>
The origin of the health problem.
</description>
</field>
</fields>
</class>
<class stash.storable="true"
jpox.table="HEALTH_ARTIFACTS">
<name>ArchivaArtifactHealth</name>
<version>1.0.0+</version>
<fields>
<field>
<name>artifact</name>
<identity>true</identity>
<version>1.0.0+</version>
<required>true</required>
<association>
<type>ArchivaArtifactModel</type>
<multiplicity>1</multiplicity>
</association>
<description>
The Artifact to report on.
</description>
</field>
<field>
<name>problems</name>
<identity>false</identity>
<version>1.0.0+</version>
<required>false</required>
<association>
<type>HealthProblem</type>
<multiplicity>*</multiplicity>
</association>
<description>
The list of problems associated with this artifact.
</description>
</field>
</fields>
</class>
<class stash.storable="true"
jpox.table="HEALTH_REPOSITORY_METADATAS">
<name>ArchivaRepositoryMetadataHealth</name>
<version>1.0.0+</version>
<fields>
<field>
<name>repositoryMetadata</name>
<identity>true</identity>
<version>1.0.0+</version>
<required>true</required>
<association>
<type>ArchivaRepositoryMetadata</type>
<multiplicity>1</multiplicity>
</association>
<description>
The ArchivaRepositoryMetadata to report on.
</description>
</field>
<field>
<name>problems</name>
<identity>false</identity>
<version>1.0.0+</version>
<required>false</required>
<association>
<type>HealthProblem</type>
<multiplicity>*</multiplicity>
</association>
<description>
The list of problems associated with this repository metadata.
</description>
</field>
</fields>
</class>
<class stash.storable="true"
jpox.table="REPOSITORY_STATS">
<name>RepositoryContentStatistics</name>
<version>1.0.0+</version>
<fields>
<field>
<name>repositoryId</name>
<version>1.0.0+</version>
<identity>false</identity>
<required>true</required>
<type>String</type>
<description>
The repository id the statistics belong to.
</description>
</field>
<field>
<name>whenGathered</name>
<version>1.0.0+</version>
<identity>false</identity>
<required>true</required>
<type>Date</type>
<description>
The timestamp on when this set of statistics was gathered.
</description>
</field>
<field>
<name>duration</name>
<version>1.0.0+</version>
<identity>false</identity>
<required>true</required>
<type>long</type>
<description>
The duration (in milliseconds) for the gathering of the statistics.
</description>
</field>
<field>
<name>totalFileCount</name>
<version>1.0.0+</version>
<identity>false</identity>
<required>true</required>
<type>long</type>
<description>
The total number of files in the repository.
</description>
</field>
<field>
<name>newFileCount</name>
<version>1.0.0+</version>
<identity>false</identity>
<required>true</required>
<type>long</type>
<description>
The number of new files discovered.
</description>
</field>
</fields>
<codeSegments>
<codeSegment>
<version>1.0.0+</version>
<code>
private transient long startTimestamp;
public void triggerStart() {
startTimestamp = System.currentTimeMillis();
}
public void triggerFinished() {
long finished = System.currentTimeMillis();
setDuration( finished - startTimestamp );
setWhenGathered( new java.util.Date( finished ) );
}
public void increaseFileCount() {
this.totalFileCount++;
}
public void increaseNewFileCount() {
this.newFileCount++;
}
</code>
</codeSegment>
</codeSegments>
</class>
</classes>
</model>