Questions tagged [enumerated]

9 questions
1
vote
1 answer

Create Array of Dates from JSON

I would like to create an array of dates (or of tuples including an index and a data) from the following JSON. My code is creating an array but instead of creating an array of dates, it breaks up the dates into characters. What do I need to do to…
user6631314
  • 1,751
  • 1
  • 13
  • 44
1
vote
1 answer

Convert enum to char

I'm working on a Hibernate project, here is an extract of my class: @Entity @Table(name = "T_JOB") @SequenceGenerator(name = "seqJob", sequenceName = "SEQ_JOB", allocationSize = 1) @Getter @Setter public class Job { @Convert(converter =…
C.Norris
  • 87
  • 1
  • 13
1
vote
2 answers

Swift: For Loop to iterate through enumerated array by index greater than 1

Is there a way to use a for-in loop through an array of strings by an index greater than 1 using .enumerated() and stride, in order to keep the index and the value? For example, if I had the array var testArray2: [String] = ["a", "b", "c", "d",…
Biggytiny
  • 519
  • 10
  • 29
1
vote
1 answer

Call Array.reduce(_:_) from enumerated array

Normal reduce call: [1,2,3].reduce(0, { cur, val in return val }) Attempt at calling reduce from an EnumeratedSequence>: [1,2,3].enumerated().reduce(0, { cur, (index, element) in return element }) // Error:…
RobertJoseph
  • 7,968
  • 12
  • 68
  • 113
0
votes
1 answer

Enum values are not saved in the database(PostgreSql)

The issue is that the enum values are not being saved in the database, so whenever I register new user it returns user with 0 role size even though I have all the right configurations, so came to the root cause which is enum values of ERole not…
0
votes
1 answer

How to index and search an ENUM type with Hibernate-Search

I am working in a Spring, Jpa, Hibernate-Search, Lucene application. I want to index a JPA entity which has a ENUM property and use Lucene to search on that. Every element in my ENUM has a int value. I put the @Field annotation on the property, but…
alexcornejo
  • 163
  • 1
  • 12
0
votes
0 answers

Hibernate Enumerated(EnumType.STRING)

How I can save Enum's String value (password) to database? Now I can save only Enum type (ID_CARD, INTERNATIONAL_PASSPORT). My Enum Class public enum Citizen { ID_CARD("Id card"), INTERNATIONAL_PASSPORT("International passport"), …
user8115811
0
votes
3 answers

My switch statement is always returning the first case?

I'm having some trouble with this code. I'm pretty new to a switch statements and enumerated types so may be overextending a bit. I managed to work this to enter the switch statement, but it keeps returning the first case. Any ideas why? #include…
Benjamin M
  • 11
  • 1
-1
votes
1 answer

How to save enumerated ints to empty list?

1) I have a text file, inside has some key values that MAY occur many times ( for example '002' or '006' or '007' 2) I have written some code, to find the line number, for EACH time a specific occurrence of '002'is found 3) The code works, but the…
JCole869
  • 3
  • 1