mirror of
https://github.com/Rogiel/l2jserver2
synced 2026-01-27 13:12:47 +00:00
DAO abstractions and updated 'npc' sql file
Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
@@ -33,15 +33,8 @@ import com.l2jserver.service.database.DataAccessObject;
|
||||
*
|
||||
* @author Rogiel
|
||||
*/
|
||||
public interface CharacterDAO extends DataAccessObject<L2Character>, Cacheable {
|
||||
/**
|
||||
* Load the instance represented by <tt>id</tt> from the database
|
||||
*
|
||||
* @param id
|
||||
* the id
|
||||
*/
|
||||
L2Character load(CharacterID id);
|
||||
|
||||
public interface CharacterDAO extends
|
||||
DataAccessObject<L2Character, CharacterID>, Cacheable {
|
||||
/**
|
||||
* Load the members of the given <tt>clan</tt>
|
||||
*
|
||||
@@ -76,16 +69,4 @@ public interface CharacterDAO extends DataAccessObject<L2Character>, Cacheable {
|
||||
*/
|
||||
@IgnoreCaching
|
||||
List<CharacterID> listIDs();
|
||||
|
||||
/**
|
||||
* Save the instance to the database. If a new database entry was created
|
||||
* returns true.
|
||||
*
|
||||
* @param option
|
||||
* the id
|
||||
* @return true if created a new entry in database (i.e. insert), false if
|
||||
* not created (i.e. update)
|
||||
*/
|
||||
@IgnoreCaching
|
||||
boolean save(L2Character character);
|
||||
}
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
*/
|
||||
package com.l2jserver.db.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.model.id.object.CharacterID;
|
||||
import com.l2jserver.model.game.CharacterFriend;
|
||||
import com.l2jserver.model.id.FriendID;
|
||||
import com.l2jserver.model.world.L2Character;
|
||||
import com.l2jserver.model.world.character.CharacterFriendList;
|
||||
import com.l2jserver.service.cache.Cacheable;
|
||||
@@ -31,17 +30,8 @@ import com.l2jserver.service.database.DataAccessObject;
|
||||
*
|
||||
* @author Rogiel
|
||||
*/
|
||||
public interface CharacterFriendDAO extends DataAccessObject<CharacterID>,
|
||||
Cacheable {
|
||||
/**
|
||||
* Load the friend list for character represented by <tt>id</tt> from the
|
||||
* database
|
||||
*
|
||||
* @param id
|
||||
* the id
|
||||
*/
|
||||
List<CharacterID> load(CharacterID id);
|
||||
|
||||
public interface CharacterFriendDAO extends
|
||||
DataAccessObject<CharacterFriend, FriendID>, Cacheable {
|
||||
/**
|
||||
* Load the friend list for character represented by <tt>character</tt> from
|
||||
* the database
|
||||
@@ -71,15 +61,4 @@ public interface CharacterFriendDAO extends DataAccessObject<CharacterID>,
|
||||
* @return true if at least 1 item was removed
|
||||
*/
|
||||
boolean delete(CharacterFriendList friends);
|
||||
|
||||
/**
|
||||
* Delete an <tt>friend</tt> from an <tt>character</tt>
|
||||
*
|
||||
* @param character
|
||||
* the character id
|
||||
* @param friend
|
||||
* the friend id
|
||||
* @return true if the item was removed
|
||||
*/
|
||||
boolean delete(CharacterID character, CharacterID friend);
|
||||
}
|
||||
|
||||
@@ -30,15 +30,7 @@ import com.l2jserver.service.database.DataAccessObject;
|
||||
*
|
||||
* @author Rogiel
|
||||
*/
|
||||
public interface ClanDAO extends DataAccessObject<Clan>, Cacheable {
|
||||
/**
|
||||
* Load the instance represented by <tt>id</tt> from the database
|
||||
*
|
||||
* @param id
|
||||
* the id
|
||||
*/
|
||||
Clan load(ClanID id);
|
||||
|
||||
public interface ClanDAO extends DataAccessObject<Clan, ClanID>, Cacheable {
|
||||
/**
|
||||
* Loads an List of all {@link ID}s in the database
|
||||
*
|
||||
@@ -46,16 +38,4 @@ public interface ClanDAO extends DataAccessObject<Clan>, Cacheable {
|
||||
*/
|
||||
@IgnoreCaching
|
||||
List<ClanID> listIDs();
|
||||
|
||||
/**
|
||||
* Save the instance to the database. If a new database entry was created
|
||||
* returns true.
|
||||
*
|
||||
* @param option
|
||||
* the id
|
||||
* @return true if created a new entry in database (i.e. insert), false if
|
||||
* not created (i.e. update)
|
||||
*/
|
||||
@IgnoreCaching
|
||||
boolean save(Clan character);
|
||||
}
|
||||
|
||||
@@ -32,15 +32,7 @@ import com.l2jserver.service.database.DataAccessObject;
|
||||
*
|
||||
* @author Rogiel
|
||||
*/
|
||||
public interface ItemDAO extends DataAccessObject<Item>, Cacheable {
|
||||
/**
|
||||
* Load the instance represented by <tt>id</tt> from the database
|
||||
*
|
||||
* @param id
|
||||
* the id
|
||||
*/
|
||||
Item load(ItemID id);
|
||||
|
||||
public interface ItemDAO extends DataAccessObject<Item, ItemID>, Cacheable {
|
||||
/**
|
||||
* Load the inventory for an {@link L2Character character}.
|
||||
*
|
||||
@@ -57,16 +49,4 @@ public interface ItemDAO extends DataAccessObject<Item>, Cacheable {
|
||||
*/
|
||||
@IgnoreCaching
|
||||
List<ItemID> listIDs();
|
||||
|
||||
/**
|
||||
* Save the instance to the database. If a new database entry was created
|
||||
* returns true.
|
||||
*
|
||||
* @param option
|
||||
* the id
|
||||
* @return true if created a new entry in database (i.e. insert), false if
|
||||
* not created (i.e. update)
|
||||
*/
|
||||
@IgnoreCaching
|
||||
boolean save(Item character);
|
||||
}
|
||||
|
||||
@@ -31,16 +31,7 @@ import com.l2jserver.service.database.DataAccessObject;
|
||||
*
|
||||
* @author Rogiel
|
||||
*/
|
||||
public interface NPCDAO extends DataAccessObject<NPC>, Cacheable {
|
||||
/**
|
||||
* Load the instance represented by <tt>id</tt> from the database
|
||||
*
|
||||
* @param id
|
||||
* the id
|
||||
* @return the instance loaded
|
||||
*/
|
||||
NPC load(NPCID id);
|
||||
|
||||
public interface NPCDAO extends DataAccessObject<NPC, NPCID>, Cacheable {
|
||||
/**
|
||||
* Load all {@link NPC} instances
|
||||
*
|
||||
@@ -64,35 +55,4 @@ public interface NPCDAO extends DataAccessObject<NPC>, Cacheable {
|
||||
*/
|
||||
@IgnoreCaching
|
||||
List<NPCID> listIDs();
|
||||
|
||||
/**
|
||||
* Save the instance to the database. If a new database entry was created
|
||||
* returns true.
|
||||
*
|
||||
* @param npc
|
||||
* the npc
|
||||
* @return true if created a new entry in database (i.e. insert), false if
|
||||
* not created (i.e. update)
|
||||
*/
|
||||
@IgnoreCaching
|
||||
boolean save(NPC npc);
|
||||
|
||||
/**
|
||||
* Save the instance to the database. If a new database entry was created
|
||||
* returns true.
|
||||
*
|
||||
* @param npc
|
||||
* the npc
|
||||
*/
|
||||
@IgnoreCaching
|
||||
void insert(NPC npc);
|
||||
|
||||
/**
|
||||
* Updates the instance to the database.
|
||||
*
|
||||
* @param npc
|
||||
* the npc
|
||||
*/
|
||||
@IgnoreCaching
|
||||
void update(NPC npc);
|
||||
}
|
||||
|
||||
@@ -30,15 +30,7 @@ import com.l2jserver.service.database.DataAccessObject;
|
||||
*
|
||||
* @author Rogiel
|
||||
*/
|
||||
public interface PetDAO extends DataAccessObject<Pet>, Cacheable {
|
||||
/**
|
||||
* Load the instance represented by <tt>id</tt> from the database
|
||||
*
|
||||
* @param id
|
||||
* the id
|
||||
*/
|
||||
Pet load(PetID id);
|
||||
|
||||
public interface PetDAO extends DataAccessObject<Pet, PetID>, Cacheable {
|
||||
/**
|
||||
* Loads an List of all {@link ID}s in the database
|
||||
*
|
||||
@@ -46,16 +38,4 @@ public interface PetDAO extends DataAccessObject<Pet>, Cacheable {
|
||||
*/
|
||||
@IgnoreCaching
|
||||
List<PetID> listIDs();
|
||||
|
||||
/**
|
||||
* Save the instance to the database. If a new database entry was created
|
||||
* returns true.
|
||||
*
|
||||
* @param option
|
||||
* the id
|
||||
* @return true if created a new entry in database (i.e. insert), false if
|
||||
* not created (i.e. update)
|
||||
*/
|
||||
@IgnoreCaching
|
||||
boolean save(Pet character);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user