Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added decorator feature and minor naming fixes
- Loading branch information
Showing
14 changed files
with
665 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
144 changes: 144 additions & 0 deletions
144
jsf/pastecode/ejb/src/main/java/org/jboss/weld/examples/pastecode/model/CodeEntity.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2009, Red Hat Middleware LLC, and individual contributors | ||
* by the @authors tag. See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.jboss.weld.examples.pastecode.model; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Column; | ||
import javax.persistence.Temporal; | ||
import javax.persistence.TemporalType; | ||
import javax.persistence.Lob; | ||
import java.util.Date; | ||
|
||
/** | ||
* The persistent class for the code database table. | ||
* | ||
*/ | ||
@Entity | ||
@Table(name = "code") | ||
public class CodeEntity implements Serializable, Cloneable | ||
{ | ||
private static final long serialVersionUID = 1L; | ||
private int id; | ||
private Date datetime; | ||
private String language; | ||
private String note; | ||
private String text; | ||
private String user; | ||
private String hash; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
public int getId() | ||
{ | ||
return id; | ||
} | ||
|
||
public void setId(int id) | ||
{ | ||
this.id = id; | ||
} | ||
|
||
@Column(name = "hash") | ||
public String getHash() | ||
{ | ||
return hash; | ||
} | ||
|
||
public void setHash(String hash) | ||
{ | ||
this.hash = hash; | ||
} | ||
|
||
public CodeEntity() | ||
{ | ||
this.language = ""; | ||
this.note = ""; | ||
this.text = ""; | ||
this.user = ""; | ||
this.hash = null; | ||
this.datetime = null; | ||
} | ||
|
||
@Temporal(TemporalType.TIMESTAMP) | ||
@Column(name = "datetime") | ||
public Date getDatetime() | ||
{ | ||
return this.datetime; | ||
} | ||
|
||
public void setDatetime(Date datetime) | ||
{ | ||
this.datetime = datetime; | ||
} | ||
|
||
@Column(name = "language") | ||
public String getLanguage() | ||
{ | ||
return this.language; | ||
} | ||
|
||
public void setLanguage(String language) | ||
{ | ||
this.language = language; | ||
} | ||
|
||
@Lob() | ||
@Column(name = "note") | ||
public String getNote() | ||
{ | ||
return this.note; | ||
} | ||
|
||
public void setNote(String note) | ||
{ | ||
this.note = note; | ||
} | ||
|
||
@Lob() | ||
@Column(name = "text") | ||
public String getText() | ||
{ | ||
return this.text; | ||
} | ||
|
||
public void setText(String text) | ||
{ | ||
this.text = text; | ||
} | ||
|
||
@Column(name = "user") | ||
public String getUser() | ||
{ | ||
return this.user; | ||
} | ||
|
||
public void setUser(String user) | ||
{ | ||
this.user = user; | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
jsf/pastecode/ejb/src/main/java/org/jboss/weld/examples/pastecode/model/LargeCodeLog.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2009, Red Hat Middleware LLC, and individual contributors | ||
* by the @authors tag. See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.jboss.weld.examples.pastecode.model; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Column; | ||
import javax.persistence.Temporal; | ||
import javax.persistence.TemporalType; | ||
import java.util.Date; | ||
|
||
@Entity | ||
@Table(name = "largecodelog") | ||
public class LargeCodeLog implements Serializable | ||
{ | ||
private static final long serialVersionUID = 1L; | ||
private int id; | ||
private Date datetime; | ||
private int codeId; | ||
private String access; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
public int getId() | ||
{ | ||
return id; | ||
} | ||
|
||
public void setId(int id) | ||
{ | ||
this.id = id; | ||
} | ||
|
||
public LargeCodeLog(int codeId, Date dateTime, String access) | ||
{ | ||
this.codeId = codeId; | ||
this.datetime = dateTime; | ||
this.access = access; | ||
} | ||
|
||
public int getCodeId() | ||
{ | ||
return codeId; | ||
} | ||
|
||
public void setCodeId(int codeId) | ||
{ | ||
this.codeId = codeId; | ||
} | ||
|
||
public String getAccess() | ||
{ | ||
return access; | ||
} | ||
|
||
public void setAccess(String access) | ||
{ | ||
this.access = access; | ||
} | ||
|
||
@Temporal(TemporalType.TIMESTAMP) | ||
@Column(name = "datetime") | ||
public Date getDatetime() | ||
{ | ||
return this.datetime; | ||
} | ||
|
||
public void setDatetime(Date datetime) | ||
{ | ||
this.datetime = datetime; | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
jsf/pastecode/ejb/src/main/java/org/jboss/weld/examples/pastecode/session/Code.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2009, Red Hat Middleware LLC, and individual contributors | ||
* by the @authors tag. See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.jboss.weld.examples.pastecode.session; | ||
|
||
import javax.ejb.Local; | ||
import java.util.List; | ||
import org.jboss.weld.examples.pastecode.model.CodeEntity; | ||
|
||
@Local | ||
public interface Code | ||
{ | ||
public String addCode(CodeEntity code, boolean secured); | ||
|
||
public CodeEntity getCode(String id); | ||
|
||
public List<CodeEntity> recentCodes(); | ||
|
||
public List<CodeEntity> searchCodes(CodeEntity code, int page, QueryInfo info); | ||
} |
Oops, something went wrong.