Created
October 22, 2013 20:17
-
-
Save lincolnthree/7107422 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.ocpsoft.redoculous.io.model.repositories; | |
| import javax.persistence.Column; | |
| import javax.persistence.Entity; | |
| import javax.persistence.EnumType; | |
| import javax.persistence.Enumerated; | |
| import javax.persistence.ManyToOne; | |
| import org.ocpsoft.redoculous.io.model.DeletableObject; | |
| @Entity | |
| public class SourceRepository extends DeletableObject<SourceRepository> | |
| { | |
| private static final long serialVersionUID = -5073498985294369095L; | |
| @Column(length = 128) | |
| private String url; | |
| @Column | |
| @Enumerated(EnumType.STRING) | |
| private VCSType type; | |
| @Column | |
| private String apiKey; | |
| @ManyToOne | |
| private UserAccount account; | |
| /** | |
| * Getters and Setters | |
| */ | |
| public UserAccount getAccount() | |
| { | |
| return this.account; | |
| } | |
| public void setAccount(final UserAccount account) | |
| { | |
| this.account = account; | |
| } | |
| public String getUrl() | |
| { | |
| return this.url; | |
| } | |
| public void setUrl(final String url) | |
| { | |
| this.url = url; | |
| } | |
| public String getApiKey() | |
| { | |
| return this.apiKey; | |
| } | |
| public void setApiKey(final String apiKey) | |
| { | |
| this.apiKey = apiKey; | |
| } | |
| @Override | |
| public String toString() | |
| { | |
| String result = getClass().getSimpleName() + " "; | |
| result += "serialVersionUID: " + serialVersionUID; | |
| if (url != null && !url.trim().isEmpty()) | |
| result += ", url: " + url; | |
| if (apiKey != null && !apiKey.trim().isEmpty()) | |
| result += ", apiKey: " + apiKey; | |
| return result; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@entity
@IdentityManaged({CustomUser.class})
@MappedAttribute("sources")
public class SourceRepository extends DeletableObject
{
private static final long serialVersionUID = -5073498985294369095L;
@column(length = 128)
private String url;
@column
@Enumerated(EnumType.STRING)
private VCSType type;
@column
private String apiKey;
@manytoone
@OwnerReference
private AccountTypeEntity account;
}