Yeah, this project I can't share anything in code.
But here are the versions
Java 7
SDN - <spring-data-neo4j.version>2.1.0.RELEASE</spring-data-neo4j.version>
AspectJ - <aspectj.version>1.6.12</aspectj.version>
Also we are using Groovy so in the compiler plugin
Code:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerId>groovy-eclipse-compiler</compilerId>
<verbose>false</verbose>
<encoding>UTF-8</encoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
</dependency>
</dependencies>
</plugin>
FOr the aspectJ plugin
Code:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.2</version>
<dependencies>
<!-- NB: You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.12</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.12</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
I guess I can post one domain object
Code:
@Entity
@Table(name="AccountUser")
@NodeEntity(partial = true)
class Account implements UserDetails {
public static final String FAVORITE_TABLES = "FAVORITE_TABLES";
public static final String FAVORITE_VIDEOS = "FAVORITE_VIDEOS";
public static final String FRIENDS_LIST = "FRIENDS_LIST";
public static final String USER_VIDEOS = "USER_VIDEOS";
public static final String USER_MAILBOX = "USER_MAILBOX";
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Long id
String firstName
String lastName
Locale locale
TimeZone timeZone
Date lastModified
Date birthday
@ManyToOne
@JoinColumn(name="currency_id")
Currency currencyId
String email
@ManyToMany(cascade = CascadeType.ALL)
Set<UserGroup> groups
@ManyToMany(cascade = CascadeType.ALL)
Set<UserRole> roles
// Properties for UserDetails
Collection<? extends GrantedAuthority> getAuthorities() {
Collection<? extends GrantedAuthority> authorities = new ArrayList<? extends GrantedAuthority>()
roles.each{ role ->
authorities << new SimpleGrantedAuthority(role.role)
}
groups.each{ group ->
authorities << new SimpleGrantedAuthority(group.group)
}
return authorities
}
String password
String username
@Transient
boolean accountNonExpired = true
@Transient
boolean accountNonLocked = true
@Transient
boolean credentialsNonExpired = true
@Transient
boolean enabled = true
// Neo4 Graph stuff
@GraphId
//@Transient
Long nodeId
@RelatedTo(type = Account.FAVORITE_TABLES)
//@Transient
Set<GameTable> favoriteTables
public void addFavoriteTables(GameTable favoriteTable) {
if (favoriteTables == null) {
this.favoriteTables = new HashSet<GameTable>();
}
favoriteTables.add(favoriteTable);
}
@RelatedTo(type = Account.FAVORITE_VIDEOS)
//@Transient
Set<Video> favoriteVideos
public void addFavoriteVideos(Video favoriteVideo) {
if (favoriteVideos == null) {
this.favoriteVideos = new HashSet<Video>();
}
favoriteVideos.add(favoriteVideo);
}
@RelatedToVia(type = Account.USER_VIDEOS)
//@Transient
Set<VideoUpload> myVideos
public void addMyVideo(VideoUpload myVideo) {
if (myVideos == null) {
this.myVideos = new HashSet<VideoUpload>();
}
myVideos.add(myVideo);
}
@RelatedToVia(type = Account.FRIENDS_LIST)
//@Transient
Set<FriendList> friendLists
public void addFriendList(FriendList friendList) {
if (friendLists == null) {
this.friendLists = new HashSet<FriendList>();
}
friendLists.add(friendList);
}
@RelatedToVia(type = Account.USER_MAILBOX)
//@Transient
Set<MailboxMessage> mailboxMessages
public void addMailboxMessage(MailboxMessage mailboxMessage) {
if (mailboxMessages == null) {
this.mailboxMessages = new HashSet<MailboxMessage>();
}
mailboxMessages.add(mailboxMessage);
}
}
Thanks Michael
Mark