Skip to content

Commit

Permalink
Багфикс видов
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalii Ungurean committed Mar 2, 2025
1 parent 8e7966e commit 486cfdf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/main/java/club/ttg/dnd5/domain/book/model/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
)
public class Source extends Timestamped {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sources_id_seq")
@SequenceGenerator(name = "sources_id_seq", sequenceName = "sources_id_seq", allocationSize = 1)
private Long id;

private int page;

@ManyToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
@JoinColumn(name = "book_info_id", referencedColumnName = "sourceAcronym")
private Book bookInfo; //null -> userId made book by userId
private String userId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
@Setter
@MappedSuperclass
public abstract class CreatureProperties extends NamedEntity {

/** Тип существа */
@Enumerated(EnumType.STRING)
private BeastType type;

/** Размеры */
@Embedded
private SpeciesSize size;

/** Скорость пешком */
@Column(columnDefinition = "int default 30")
private int speed = 30;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/club/ttg/dnd5/domain/species/model/Species.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
}
)
public class Species extends CreatureProperties implements HasSourceEntity {
/** Размеры */
@Embedded
private SpeciesSize size;

/** Умения */
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public interface SpeciesMapper {
@Mapping(source = "properties.movementAttributes.fly", target = "fly")
@Mapping(source = "properties.movementAttributes.climb", target = "climb")
@Mapping(source = "properties.movementAttributes.swim", target = "swim")
@Mapping(source = "properties.darkVision", target = "darkVision")
@Mapping(source = "name.alternative", target = "alternative", qualifiedByName = "collectToString")
Species toEntity(SpeciesRequest request);

Expand Down

0 comments on commit 486cfdf

Please sign in to comment.