Skip to content

Commit

Permalink
issues/1588 janusgraph schema
Browse files Browse the repository at this point in the history
  • Loading branch information
fuss86 committed Dec 1, 2019
1 parent 8596f5b commit 537247a
Show file tree
Hide file tree
Showing 9 changed files with 805 additions and 193 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.carlspring.strongbox.janusgraph.domain;

import java.util.UUID;

import org.neo4j.ogm.annotation.NodeEntity;

/**
* @author Przemyslaw Fusik
*/
@NodeEntity
public class ChangeSet
extends DomainEntity
implements Comparable<ChangeSet>
{

private Integer order;

private String name;

public static ChangeSet build(final String name,
final Integer order)
{
ChangeSet changeSet = new ChangeSet();
changeSet.setUuid(UUID.randomUUID().toString());
changeSet.setName(name);
changeSet.setOrder(order);
return changeSet;
}

public Integer getOrder()
{
return order;
}

public void setOrder(final Integer order)
{
this.order = order;
}

public String getName()
{
return name;
}

public void setName(final String name)
{
this.name = name;
}

@Override
public int compareTo(final ChangeSet o)
{
return Integer.compare(getOrder(), o.getOrder());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.carlspring.strongbox.janusgraph.domain;

import java.util.NavigableSet;

import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;

/**
* @author Przemyslaw Fusik
*/
@NodeEntity
public class DatabaseSchema
extends DomainEntity
{

@Relationship(type = "DatabaseSchema_ChangeSet")
private NavigableSet<ChangeSet> changeSets;

public NavigableSet<ChangeSet> getChangeSets()
{
return changeSets;
}

public void setChangeSets(final NavigableSet<ChangeSet> changeSets)
{
this.changeSets = changeSets;
}
}
Loading

0 comments on commit 537247a

Please sign in to comment.