mirror of https://github.com/apache/archiva.git
Adjusting Metadata content.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@529614 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8e01424163
commit
e37599c559
|
@ -247,6 +247,21 @@ public class ArchivaModelCloner
|
|||
return cloned;
|
||||
}
|
||||
|
||||
public static SnapshotVersion clone( SnapshotVersion snapshotVersion )
|
||||
{
|
||||
if ( snapshotVersion == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
SnapshotVersion cloned = new SnapshotVersion();
|
||||
|
||||
cloned.setTimestamp( snapshotVersion.getTimestamp() );
|
||||
cloned.setBuildNumber( snapshotVersion.getBuildNumber() );
|
||||
|
||||
return cloned;
|
||||
}
|
||||
|
||||
public static VersionedReference clone( VersionedReference versionedReference )
|
||||
{
|
||||
if ( versionedReference == null )
|
||||
|
@ -506,4 +521,9 @@ public class ArchivaModelCloner
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List cloneAvailableVersions( List availableVersions )
|
||||
{
|
||||
return cloneSimpleStringList( availableVersions );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.maven.archiva.model.jpox;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.archiva.model.AbstractProjectKey;
|
||||
import org.apache.maven.archiva.model.AbstractVersionedKey;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.io.Serializable;
|
|||
* @version $Id$
|
||||
*/
|
||||
public class ArchivaRepositoryMetadataKey
|
||||
extends AbstractProjectKey
|
||||
extends AbstractVersionedKey
|
||||
implements Serializable
|
||||
{
|
||||
|
||||
|
|
|
@ -475,6 +475,16 @@
|
|||
</codeSegment>
|
||||
</codeSegments>
|
||||
</class>
|
||||
|
||||
<!-- _______________________________________________________________
|
||||
__ __ _ _ _
|
||||
| \/ | ___| |_ __ _ __| | __ _| |_ __ _
|
||||
| |\/| |/ _ \ __/ _` |/ _` |/ _` | __/ _` |
|
||||
| | | | __/ || (_| | (_| | (_| | || (_| |
|
||||
|_| |_|\___|\__\__,_|\__,_|\__,_|\__\__,_|
|
||||
|
||||
-->
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.use-identifiers-as-primary-key="false"
|
||||
jpox.identity-type="application"
|
||||
|
@ -492,7 +502,7 @@
|
|||
<type>String</type>
|
||||
<required>true</required>
|
||||
<description>
|
||||
The Group ID of the repository content.
|
||||
The Group ID of the metadata.
|
||||
</description>
|
||||
</field>
|
||||
<field jpox.primary-key="true"
|
||||
|
@ -504,7 +514,29 @@
|
|||
<type>String</type>
|
||||
<required>true</required>
|
||||
<description>
|
||||
The Artifact ID of the repository content.
|
||||
The Artifact ID of the metadata.
|
||||
</description>
|
||||
</field>
|
||||
<field jpox.primary-key="true"
|
||||
jpox.value-strategy="off"
|
||||
jpox.persistence-modifier="persistent">
|
||||
<name>version</name>
|
||||
<identifier>true</identifier>
|
||||
<version>1.0.0+</version>
|
||||
<type>String</type>
|
||||
<required>true</required>
|
||||
<description>
|
||||
The Version of the metadata.
|
||||
</description>
|
||||
</field>
|
||||
<field>
|
||||
<name>latestVersion</name>
|
||||
<identifier>false</identifier>
|
||||
<version>1.0.0+</version>
|
||||
<required>false</required>
|
||||
<type>String</type>
|
||||
<description>
|
||||
The latest version id.
|
||||
</description>
|
||||
</field>
|
||||
<field>
|
||||
|
@ -517,6 +549,19 @@
|
|||
The released version id.
|
||||
</description>
|
||||
</field>
|
||||
<field>
|
||||
<name>snapshotVersion</name>
|
||||
<identifier>false</identifier>
|
||||
<version>1.0.0+</version>
|
||||
<required>false</required>
|
||||
<description>
|
||||
The snapshot version id.
|
||||
</description>
|
||||
<association>
|
||||
<type>SnapshotVersion</type>
|
||||
<multiplicity>1</multiplicity>
|
||||
</association>
|
||||
</field>
|
||||
<field>
|
||||
<name>availableVersions</name>
|
||||
<identifier>false</identifier>
|
||||
|
@ -531,17 +576,27 @@
|
|||
</description>
|
||||
</field>
|
||||
<field>
|
||||
<name>lastModified</name>
|
||||
<name>lastUpdated</name>
|
||||
<identifier>false</identifier>
|
||||
<version>1.0.0+</version>
|
||||
<type>String</type>
|
||||
<required>true</required>
|
||||
<description>
|
||||
When the metadata was last updated.
|
||||
</description>
|
||||
</field>
|
||||
<field>
|
||||
<name>fileLastModified</name>
|
||||
<identifier>false</identifier>
|
||||
<version>1.0.0+</version>
|
||||
<type>Date</type>
|
||||
<required>true</required>
|
||||
<description>
|
||||
The Last Modified Timestamp of this artifact.
|
||||
The Last Modified Timestamp of this file.
|
||||
</description>
|
||||
</field>
|
||||
<field jpox.column="FILE_SIZE">
|
||||
<name>size</name>
|
||||
<name>fileSize</name>
|
||||
<identifier>false</identifier>
|
||||
<version>1.0.0+</version>
|
||||
<type>long</type>
|
||||
|
@ -571,8 +626,54 @@
|
|||
</description>
|
||||
</field>
|
||||
</fields>
|
||||
<codeSegments>
|
||||
<codeSegment>
|
||||
<version>1.0.0</version>
|
||||
<code>
|
||||
public void updateTimestamp()
|
||||
{
|
||||
setLastUpdatedTimestamp( new java.util.Date() );
|
||||
}
|
||||
|
||||
public void setLastUpdatedTimestamp( java.util.Date date )
|
||||
{
|
||||
java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" );
|
||||
java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" );
|
||||
fmt.setTimeZone( timezone );
|
||||
setLastUpdated( fmt.format( date ) );
|
||||
}
|
||||
</code>
|
||||
</codeSegment>
|
||||
</codeSegments>
|
||||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.table="REPOSITORY_METADATA_SNAPSHOTS">
|
||||
<name>SnapshotVersion</name>
|
||||
<description>The Snapshot Version</description>
|
||||
<version>1.0.0+</version>
|
||||
<fields>
|
||||
<field jpox.column="VERSION_TIMESTAMP">
|
||||
<name>timestamp</name>
|
||||
<type>String</type>
|
||||
<identifier>false</identifier>
|
||||
<required>true</required>
|
||||
<description>
|
||||
The unique timestamp for the snapshot version.
|
||||
</description>
|
||||
</field>
|
||||
<field>
|
||||
<name>buildNumber</name>
|
||||
<type>int</type>
|
||||
<identifier>false</identifier>
|
||||
<required>true</required>
|
||||
<description>The incremental build number of the snapshot.</description>
|
||||
</field>
|
||||
</fields>
|
||||
</class>
|
||||
|
||||
|
||||
|
||||
<!-- _______________________________________________________________
|
||||
____ __
|
||||
| _ \ ___ / _| ___ _ __ ___ _ __ ___ ___ ___
|
||||
|
|
Loading…
Reference in New Issue