Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9021413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:15:01+00:00 2026-06-16T05:15:01+00:00

In my Code.. List<WeekdayType> weekday = new ArrayList<WeekdayType>(); i’m insert the weekday into Database…

  • 0

In my Code..

List<WeekdayType> weekday = new ArrayList<WeekdayType>();

i’m insert the weekday into Database…
Hear WeekdayType is Enum

public enum WeekdayType {
MONDAY(Calendar.MONDAY), TUESDAY(Calendar.TUESDAY), WEDNESDAY(
        Calendar.WEDNESDAY), THURSDAY(Calendar.THURSDAY), FRIDAY(
        Calendar.FRIDAY), SATURDAY(Calendar.SATURDAY), SUNDAY(
        Calendar.SUNDAY);
private int day;
private WeekdayType(int day) {
    this.day = day;
}
public int getDay() {
    return day;
}}

and i’m creating Bean in Hibernate like this..

    @Entity
@Table(name="EC_TIMETABLE")
public class TimetableVO
{
-------
-----
@Column(name="REPEAT_DAYS")
    private List<WeekdayType> repeatDays;
//Setter and Getter...
}

i’m inserting the values into Database but it giving Error:

org.hibernate.MappingException: Could not determine type for: java.util.List, at table: EC_TIMETABLE, for columns: [org.hibernate.mapping.Column(REPEAT_DAYS)]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:15:02+00:00Added an answer on June 16, 2026 at 5:15 am

    You need to annotate the Enum list with @Enumerated annotation.

    @Column(name="REPEAT_DAYS")
    @Enumerated(EnumType.STRING)
    private List<WeekdayType> repeatDays;
    

    You can specify how the enum should be persisted in the database with the EnumType enum property of the @Enumerated annotation. EnumType.ORDINAL specifies that the enum will be persisted as an integer value. Here, myEnum set to VALUE1 would be persisted as 0, VALUE2 as 1, etc.

    The alternative is to use EnumType.STRING to specify that the enum will be persisted using the name of the enum value that the field is set to. So, applied to the previous example, setting the field myEnum to MyEnum.VALUE1 will persist as VALUE1, etc.

    Update:
    Also you need to specify columnDefinition property with all valid values of enum.

    @Column(name="REPEAT_DAYS", columnDefinition="enum(1,2,3)")
    

    Reference: mapping-enum-types-with-hibernate-annotations

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this code: List<Integer> ints = new ArrayList<Integer>(); // Type mismatch: // cannot convert
I have the following code: List<int> intList = new ArrayList<int>(); for (int index =
Please see the following code: List list = Collections.synchronizedList(new ArrayList()); // ... synchronized (list)
I have this piece of code List<Class<? extends SubApplication>> appClasses = new ArrayList<Class<? extends
I have very simple code: List<String> list = new ArrayList<String>(); String a = a;
I have code: List<String> list = new ArrayList<String>(); list.add(10.160.0.100;14/Nov/201107:22:38;/;-;); list.add(10.160.0.100;14/Nov/201108:54:31;/;-;); list.add(10.160.0.10;16/Nov/201112:56:38;/;-;); list.add(10.160.0.100); list.add(10.160.0.100); list.add(10.160.0.10);
I have this code: List<Runnable> r = new ArrayList<>(); for(int i = 0; i
I have this code: List<Visibility> ListVisibility = new List<Visibility>(); public class Visibility { public
I have code: List<ModelMap> nameCustomer = new ArrayList<ModelMap>(); for (int i=1;i<150;i++) { ModelMap map
I have this code: List<string> list = new List<string>(30); list.Insert(1, string 1); list.Insert(10, string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.