Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Quote:
Originally Posted by
lRetros
¿How is it Adil? ¿Any updates? ^_^
Been hibernating;
Code:
@Entity
@DynamicUpdate
@Table(name = "habbos")
public class Habbo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique = true, length = 10)
private Long id;
@Column(name = "name", unique = true, length = 32)
private String name;
@Column(name = "sso_ticket", unique = true, length = 32)
private String sso_ticket;
@Column(name = "sso_ip", length = 39)
private String sso_ip;
@Column(name = "figure", length = 256)
private String figure;
@Column(name = "gender", length = 1)
private String gender;
@Column(name = "credits")
private Long credits;
@Column(name = "motto")
private String motto;
@ManyToMany( cascade = CascadeType.ALL)
@JoinTable(name = "habbos_friends", joinColumns = {
@JoinColumn(name = "habbo_id", nullable = false ) },
inverseJoinColumns = { @JoinColumn(name = "friend_id") })
private Set<Habbo> friends;
@ManyToMany( cascade = CascadeType.ALL)
@JoinTable(name = "habbos_bans", joinColumns = {
@JoinColumn(name = "habbo_id", nullable = false) },
inverseJoinColumns = { @JoinColumn(name = "ban_id")})
private Set<Ban> bans;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "habbos_friends_requests", joinColumns = {
@JoinColumn(name = "habbo_id", nullable = false) },
inverseJoinColumns = { @JoinColumn(name = "requestor_id") })
private Set<Habbo> friendRequests;
@Column(name = "online")
private boolean isOnline;
@ManyToOne(cascade = CascadeType.ALL)
private Fuserank rank;
public Set<Habbo> getFriendRequests() {
return friendRequests;
}
public void setFriendRequests(Set<Habbo> friendRequests) {
this.friendRequests = friendRequests;
}
public boolean isOnline() {
return isOnline;
}
public void setOnline(boolean isOnline) {
this.isOnline = isOnline;
}
public Set<Ban> getBans() {
return bans;
}
public void setBans(Set<Ban> bans) {
this.bans = bans;
}
public Habbo() {
//empty
}
public void setID(Long id) {
this.id = id;
}
public Long getID() {
return this.id;
}
public void setSsoIp(String ip) {
this.sso_ip = ip;
}
public String getSsoIp() {
return this.sso_ip;
}
public String getSsoTicket() {
return this.sso_ticket;
}
public void setSsoTicket(String ticket) {
this.sso_ticket = ticket;
}
public void setCredits(Long credits) {
this.credits = credits;
}
public Long getCredits() {
return this.credits;
}
public void setFigure(String figure) {
this.figure = figure;
}
public String getFigure() {
return this.figure;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getGender() {
return this.gender;
}
public void setMotto(String motto) {
this.motto = motto;
}
public String getMotto() {
return this.motto;
}
/*
* Friends
*/
public Set<Habbo> getFriends() {
return this.friends;
}
public void setFriends(Set<Habbo> friends) {
this.friends = friends;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
public Fuserank getRank() {
return rank;
}
public void setRank(Fuserank rank) {
this.rank = rank;
}
Code:
public Habbo loadBySso(String sso) {
Habbo habbo = (Habbo)HibernateUtil.getCurrentSession().createCriteria(Habbo.class).add(Restrictions.eq("sso_ticket",
sso)).uniqueResult();
if(habbo != null) {
return habbo;
}
return null;
}
public Habbo load(Long id) {
Habbo habbo = (Habbo)HibernateUtil.getCurrentSession().load(Habbo.class, id);
if(habbo != null) {
return habbo;
}
return null;
}
public void update(Habbo habbo) {
HibernateUtil.getCurrentSession().update(habbo);
}
public List getSimilarHabbos(String name) {
List habbos = HibernateUtil.getCurrentSession().createCriteria(Habbo.class).add(Restrictions.like(
"name","%"+name+"%")).list();
return habbos;
}
Been busy :P
I'd love to hear any suggestions!
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Can you make Shark work too with V9?
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Should be stuff on there now.
Gonna get the basics done over the next few days.
Feel free to browse, copy and fork (if you're gonna take code, just make sure you add credits :):).
I have my GCSE's in a month, so shit won't be frequent. But, after the 14th of June... :)
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Quote:
Originally Posted by
Leon
This project has been in development for over 8 months and you still don't have the basics done? Wow.....
I lost the old source.
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Stop arguing, back on topic now.
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Starting on network IO tomorrow. :)
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Also, I'm using Play for the web side of stuff.
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Got @@ implemented.
Will work on handshake over the next few days.
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
kKeep working hard man, we all appreciate the effort
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
would anyone be interested in a j.me?
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Posted 16 hours ago?
I guess not then, any updates? :)
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
Going to wire up Hibernate then start working on the CMS.
https://github.com/adilhz/Shark/comm...2ac2f60d25129d
Wired up Hibernate, will work on Spring integration when I get home.
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
replies with generic message about being impressed with progress and not seeing too many apparent flaws
Re: Shark ~ [Java][Hibernate][Netty] ~ [V13]
I believe we may be doomed sometime soon